I am using Spring Boot 1.5.13 version.
I got the exception message like below.
Could not parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.4296537502689403143.5000/work/Tomcat/localhost/ROOT] is not valid
I founded out this issue in Spring Github Issues. https://github.com/spring-projects/spring-boot/issues/9616
But I still have questions of that.
Please Help me out!
You can set the multipart location in application.yml:
spring:
http:
multipart:
location: /data/upload_tmp
Update
As per comment by Vivek Sethi above property didn't work for me but the below one.
spring.servlet.multipart.location=/data/upload_tmp
Just restart your application in the server. It is a bug between spring and tomcat servers. Once the application restarts it consume a temp directory in the server.
This Issue was fixed a couple of days ago.
Spring Boot: 2.1.4 or 1.5.20
This version bump fixes an issue when the tmp dir was deleted
by the OS and the spring boot app tries to handle a multifile
upload.
Issue: https://github.com/spring-projects/spring-boot/issues/9616
https://github.com/MeiSign/Copy-Pasta/commit/1200fb353a48a3d0c92038dee7cced7cebf3acfe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With