the temporary upload location [/tmp/tomcat.4519862041770988807.8082/work/Tomcat/
程序员文章站
2022-06-08 23:23:26
...
springboot项目,上传文件,报错:the temporary upload location [/tmp/tomcat.4519862041770988807.8082/work/Tomcat/localhost/ROOT] is not valid
原因:springboot上传文件,或默认创建/tmp/tomcat.*文件夹,上传要先转换成临时文件写入这个文件夹下,这个文件夹如果长时间没有访问会被系统自动删除,大概10天。
如果长时间没有上传文件,那超过10天上传,可能会找不到这个文件夹。
解决:
1.重启项目,会重新创建文件夹。
2.yml中添加配置,指定路径,server.tomcat.basedir=/home/temp
3.java配置类:
@Bean MultipartConfigElement multipartConfigElement() { MultipartConfigFactory factory = new MultipartConfigFactory(); factory.setLocation("/home/temp"); return factory.createMultipartConfig(); }
上一篇: Feign调用报错:com.netflix.hystrix.exception.HystrixRuntimeException
下一篇: VS2010 + Framework4.0的远程调用之Break pointer cannot hit Visual Studio远程调用breakPointNo symbol loaded
推荐阅读
-
the temporary upload location [/tmp/tomcat.4519862041770988807.8082/work/Tomcat/
-
the temporary upload location [/tmp/tomcat.4519862041770988807.8082/work/Tomcat/
-
springboot内置tomcat The temporary upload location [/tmp/tomcat.73683926762623451 tmp/tomcat. springboot
-
springboot内置tomcat The temporary upload location [/tmp/tomcat.73683926762623451 tmp/tomcat. springboot