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

筅森魡賤 提交于 2020-01-18 05:21:29

编写代码,出现错误:

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 后,文件流会关闭,无法再操作文件流,如果继续试图操作该文件流,就会报以上错误。

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!