方法中定义
@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);
}
}
时间: 2024-10-22 21:17:59