How to set the equivalent of Jetty's "maxFormContentSize" in Spring Boot?

Viewed 344

We're migrating a project from a classic war project to a Spring Boot application. The old project was using Jetty and when starting the Jetty JVM we supplied the -Dorg.eclipse.jetty.server.Request.maxFormContentSize=5000000 parameter to limit the max size of form uploads. We want the same limit in our Spring Boot application. But I'm a bit confused since there are many properties to choose from in Spring Boot, for example:

server.tomcat.max-swallow-size
server.tomcat.max-http-post-size
spring.servlet.multipart.fileSizeThreshold
spring.servlet.multipart.max-file-size
spring.servlet.multipart.max-request-size

There could of course be more properties in the same vane that I don't know about.

My question is: What's the equivalent of org.eclipse.jetty.server.Request.maxFormContentSize=5000000 in Spring Boot when using the embedded tomcat web server? We're using Spring Boot 2.5.6 (but we will upgrade to 2.6.x) and we're using the standard embedded Tomcat web server with blocking IO.

1 Answers

From the spring documentation the server.jetty.max-http-form-post-size is equivalent to the org.eclipse.jetty.server.Request.maxFormContentSize property and defines the Maximum size of the form content in any HTTP post request.

Related