search

Home  >  Q&A  >  body text

java - 使用springmvc上传图片报错already exists and could not deleted

使用springmvc上传图片报错,第二次上传同名文件会报图片already exists and could not deleted
File targetFile = new File(path, changName);
if(!targetFile.exists()){
targetFile.mkdirs();
}
file.transferTo(targetFile);

PHP中文网PHP中文网2816 days ago1431

reply all(1)I'll reply

  • 高洛峰

    高洛峰2017-04-17 12:00:35

    It is recommended that you use MultipartHttpServletRequest to obtain attachment information

    reply
    0
  • Cancelreply