You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Grails 8] Oversized multipart uploads cannot be handled by Grails application code #16145
When a multipart upload exceeds the configured size limit, Tomcat may reject it while parsing request parameters before Grails’ multipart resolver or controller is invoked. As a result, the application cannot handle the failure through normal validation or error handling and cannot render the expected form error.
The request may also be wrapped by Spring Security, hiding Grails’ MultipartHttpServletRequest API and causing valid uploads using request.getFile(...) or params binding to fail.
Grails should resolve multipart requests early and preserve the resolved multipart request so both oversized-upload errors and valid file uploads remain available to application code.
FWIW: I ran into this problem and was able to get large uploads past tomcat by adding this to application.yml:
server:
tomcat:
max-swallow-size: 100MB
Thanks, @whorvath2, max-swallow-size might be a workaround to let the application get a chance to handle the response.
It does however not work-around the problem with Spring Security wrapping the request and hiding the multipart.
Activity
Let oversized uploads reach the application's error handling
Cover oversized uploads and multipart method overrides end to end
Read every framework request parameter through one tolerant helper
Stop an error handler that fails from being forwarded to forever
Cover the oversized upload path on Tomcat, Jetty and Undertow
Document what an oversized upload reaches, and where it does not
Let oversized uploads reach the application's error handling
Cover oversized uploads and multipart method overrides end to end
Read every framework request parameter through one tolerant helper
Stop an error handler that fails from being forwarded to forever
Cover the oversized upload path on Tomcat, Jetty and Undertow
Document what an oversized upload reaches, and where it does not
Let oversized uploads reach the application's error handling
Cover oversized uploads and multipart method overrides end to end
Read every framework request parameter through one tolerant helper
Stop an error handler that fails from being forwarded to forever
Cover the oversized upload path on Tomcat, Jetty and Undertow
Document what an oversized upload reaches, and where it does not
whorvath2 commentedon Aug 19, 2026
FWIW: I ran into this problem and was able to get large uploads past tomcat by adding this to application.yml:
matrei commentedon Aug 20, 2026
Thanks, @whorvath2,
max-swallow-sizemight be a workaround to let the application get a chance to handle the response.It does however not work-around the problem with Spring Security wrapping the request and hiding the multipart.