java.io.FileNotFoundException: /tmp/tomcat.89813762449…

  • Post author:
  • Post category:java


编写代码,出现错误:

java.io.FileNotFoundException: /tmp/tomcat.8981376244936680613.8081/work/Tomcat/localhost/ROOT/upload_f359ed4e_cd65_4daa_847c_effc86403d9d_00000080.tmp (No such file or directory)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at org.apache.tomcat.util.http.fileupload.disk.DiskFileItem.getInputStream(DiskFileItem.java:188)
        at org.apache.catalina.core.ApplicationPart.getInputStream(ApplicationPart.java:100)
        at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest$StandardMultipartFile.getInputStream(StandardMultipartHttpServletRequest.java:297)
        at com.manhui.api.FastfdsConfig.uploadFile(FastfdsConfig.java:35)
        at com.manhui.api.ProjectCircleController.addProjectCircle(ProjectCircleController.java:186)

代码功能为附件上传;

输入文件流在进行过一次 transferTo 后,文件流会关闭,无法再操作文件流,如果继续试图操作该文件流,就会报以上错误。



版权声明:本文为hfaflanf原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。