Skip to content

[Grails 8] Oversized multipart uploads cannot be handled by Grails application code #16145

Closed

Description

@matrei

Issue description

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.

Activity

  1. added this to the grails:8.0.0-RC1 milestone on Aug 13, 2026
  2. whorvath2 commented on Aug 19, 2026

    @whorvath2

    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
    
  3. matrei commented on Aug 20, 2026

    @matrei
    ContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions