Is there a maximum file size that spring boot can handle in a MultipartFile
upload process. I know that I can set the maxFileSize
in the property like multipart.maxFileSize=1Mb
.
So, like that can I allow a huge file to upload, like 50MB. The application runs on the Tomcat server integrated with Spring Boot. Do I need to configure the tomcat server also? Or is the file size unlimited?
spring. servlet. multipart. max-file-size is set to 128KB, meaning total file size cannot exceed 128KB.
A representation of an uploaded file received in a multipart request. The file contents are either stored in memory or temporarily on disk. In either case, the user is responsible for copying file contents to a session-level or persistent store as and if desired.
Class MultipartProperties max-request-size specifies the maximum size allowed for multipart/form-data requests. The default is 10MB.
For those using Spring Boot 2.0 (as of M1 release), the property names have changed to:
spring.servlet.multipart.max-file-size=10MB spring.servlet.multipart.max-request-size=10MB
Note the prefix is spring.servlet
instead of spring.http
.
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