Max Limit of MultipartFile in spring boot

2019-01-22 07:54发布

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?

3条回答
祖国的老花朵
2楼-- · 2019-01-22 08:14

Actually setting multipart.max-file-size=128MB multipart.max-request-size=128MB works for me without additional configurations.

查看更多
smile是对你的礼貌
3楼-- · 2019-01-22 08:17

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".

查看更多
放荡不羁爱自由
4楼-- · 2019-01-22 08:21

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

multipart.maxFileSize=-1

multipart.maxRequestSize=-1

查看更多
登录 后发表回答