I\'m using Spring Boot and need to let users upload files for processing. Right now, the file uploads to /home/username/git/myproject which is not great.
How do I make S
Since you are using Spring Boot it's easier to use the MultipartProperties
in your application.properties
file.
From documentation properties example:
# MULTIPART (MultipartProperties)
multipart.enabled=true
multipart.file-size-threshold=0 # Threshold after which files will be written to disk.
multipart.location= # Intermediate location of uploaded files.
multipart.max-file-size=1Mb # Max file size.
multipart.max-request-size=10Mb # Max request size.
Also you could read a detailed description from the MultipartProperties.
In order to configure to your system tmpdir, you could set:
multipart.location=${java.io.tmpdir}