欢迎光临
感受代码之美

Springboot上传文件报错:the temporary upload location is not valid

Springboot上传文件报错

Failed to parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/data/upload_tmp/work/Tomcat/localhost/ROOT] is not valid

首先保证设置的临时目录有权限访问,然后进行如下配置:

解决方法一

配置server.tomcat.basedir

server:
  tomcat:
    basedir: /data/upload_tmp

解决方法二

启动脚本修改

-Djava.io.tmpdir=/opt/tridion/deployer-live/tmp

参考:

  1. SpringBoot文件上传异常之提示The temporary upload location xxx is not valid
  2. Temporary upload location is not valid
赞(0)
未经允许禁止转载:四个空格 » Springboot上传文件报错:the temporary upload location is not valid

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址