Advertise with us

Search Mastertheboss

Our eBooks

Configuring WildFly upload file size

If you implement a file upload in your web frontend and want to send the data to the WildFly with HTTP POST, the WildFly will put a stop to it as soon as a certain file size is exceeded. The default value for the size of a POST request is 10MB.

wildfly

So how to configure WildFly upload file limit ? In order to do that, change the max-post-size attribute in the undertow subsystem:

/subsystem=undertow/server=default-server/http-listener=default/:write-attribute(name=max-post-size,value=25485760)  

That will result in the following configuration:

 <subsystem xmlns="urn:jboss:domain:undertow:3.0">  
            <buffer-cache name="default"/>  
            <server name="default-server">  
                <http-listener name="default" max-post-size="25485760" redirect-socket="https" socket-binding="http"/>  <!-- NOTICE max-post-size="25485760"  -->  
                <host name="default-host" alias="localhost">  
                    <location name="/" handler="welcome-content"/>  
                    <filter-ref name="server-header"/>  
                    <filter-ref name="x-powered-by-header"/>  
                </host>  
            </server>  

You can also disable the max post size limit by setting the max-post-size parameter to 0. Run the following CLI command:

 /subsystem=web/connector=http:write-attribute(name=max-post-size, value=0)
© 2020 mastertheboss.com. All Rights Reserved.

Please publish modules in offcanvas position.