'Springboot temp directory
I created an application that my user can upload, so far so good, but after a few days that my application is started his temporary directory disappears (I do not know if the OS goes out or something) and from then on the upload not It works more. I need to either restart my application or recreate the directory (an example directory "/tmp/tomcat.323231231312.8282/work/Tomcat/localhost/myapp"
[EDITED] I already saves all files in a separated file, but the springboot saves the files in a temp directory until upload finish, then I have access to that file
Solution 1:[1]
Please provide below property :
spring.http.multipart.location: /data/upload_tmp
This will enable spring boot to create desired folder for hosting upload files.
Solution 2:[2]
Why can`t you create sepearate directory for upload activities using spring boot and even log into seperate logger too? Any restriction from application side to go for temp?
Refer this if it replacates the same.
How to create a directory on statup in spring boot project
Try if this is useful How does one specify a temp directory for file uploads in Spring Boot?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Techienik |
| Solution 2 |
