标签:file
方法中定义
@RequestMapping("/doPoint")
@ResponseBody
参数HttpServletRequest request
List<MultipartFile> multipartFiles = null;
try {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
multipartFiles = multipartRequest.getFiles("fileUpload");
logger.debug(user.getAccount()+"--上传文件!--");
} catch (Exception Ex) {
logger.debug(user.getAccount()+"--无上传文件!--");
}finally{
MultipartFile[] fileUpload = new MultipartFile[multipartFiles.size()];
for (int i = 0; i < multipartFiles.size(); i++) {
fileUpload[i] = multipartFiles.get(i);
}
}
标签:file
原文地址:http://tianjian.blog.51cto.com/3549910/1666004