为何上传成功了,但是在对应文件夹中没找到呢?
@RequestMapping(value="/doUpload",method=RequestMethod.POST) //Spring MVC会将Request中name为file的值绑定到参数中 public String doUpload(@RequestParam("file") MultipartFile file) throws IOException{ if(file.isEmpty()){ log.debug("process file:{}"+file.getOriginalFilename()); //文件的拷贝 FileUtils.copyInputStreamToFile(file.getInputStream(), new File("F:/temp/", System.currentTimeMillis()+file.getOriginalFilename())); } return "success"; }