方法中定义
@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);
}
}
本文转自tianjian_0913 51CTO博客,原文链接:http://blog.51cto.com/tianjian/1666004
,如需转载请自行联系原作者