Max limit of MultipartFile in Spring Boot

前端 未结 5 757
予麋鹿
予麋鹿 2020-11-29 01:52

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 l

5条回答
  •  死守一世寂寞
    2020-11-29 02:22

    Spring Boot have embbeed Tomcat with it so we don't need to configure it. MULTIPART properties in application-properties will take care of it.

    For an external server, the default limit is 50MB. We can see it by opening webapps/manager/WEB-INF/web.xml

    
       52428800
       52428800
       0
    
    

    MULTIPART properties have been changed according to versions.

    Spring Boot 1.3.x and earlier

    multipart.max-file-size
    multipart.max-request-size
    

    After Spring Boot 1.3.x:

    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 
    

提交回复
热议问题