Increase HTTP Post maxPostSize in Spring Boot

后端 未结 14 2239
无人共我
无人共我 2020-11-28 06:48

I\'ve got a fairly simple Spring Boot web application, I have a single HTML page with a form with enctype=\"multipart/form-data\". I\'m getting this error:

14条回答
  •  悲哀的现实
    2020-11-28 07:21

    The error here is not caused by max-file-size or max-request-size (as pointed out) but rather the container-specific max-http-post-size property. For tomcat (the default container), you can set:

    server.tomcat.max-http-post-size: 10MB
    

    Jetty:

    server.jetty.max-http-post-size: 10MB
    

    Undertow:

    server.undertow.max-http-post-size: 10MB
    

    This has the same effect as OP's answer here, but via application.properties which is much more preferable.

提交回复
热议问题