Max limit of MultipartFile in Spring Boot

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.


For unlimited upload file size

It seems setting -1 will make it for infinite file size.

Before Spring Boot 2.0:

spring.http.multipart.max-file-size=-1
spring.http.multipart.max-request-size=-1

After Spring Boot 2.0:

spring.servlet.multipart.max-file-size=-1
spring.servlet.multipart.max-request-size=-1