大家好,又见面了,我是你们的朋友全栈君。
Controller中
//调用
ReceivePIC.receivePIC(request, response);
//封装的方法
package com.jwwl.fsq.util;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
//存储图片到本地相应位置
public class ReceivePIC {
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/160451.html原文链接:https://javaforall.cn