Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Max limit of MultipartFile in Spring Boot

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?

like image 954
Ravindu Avatar asked Dec 09 '15 11:12

Ravindu


People also ask

What is spring servlet multipart Max-file-size?

spring. servlet. multipart. max-file-size is set to 128KB, meaning total file size cannot exceed 128KB.

What is MultipartFile spring boot?

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.

What is multipart Max-request-size?

Class MultipartProperties max-request-size specifies the maximum size allowed for multipart/form-data requests. The default is 10MB.


1 Answers

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.

like image 130
A. Thom Avatar answered Sep 27 '22 19:09

A. Thom