java - 使用springmvc上传图片报错already exists and could not deleted
PHP中文网2017-04-17 11:58:35
0
1
1376
使用springmvc上传图片报错,第二次上传同名文件会报图片already exists and could not deleted
File targetFile = new File(path, changName);
if(!targetFile.exists()){
targetFile.mkdirs();
}
file.transferTo(targetFile);
推荐你使用MultipartHttpServletRequest这种方式获取附件信息