3/23/15

Increase Tomcat Upload File Size Limit

Today while deploying xyz.war file (development site code) in Tomcat (version 7.057), I faced following issue regarding upload limit size in Tomcat.
Caused by: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (128382112) exceeds the configured maximum (104828800)

Increase Tomcat Upload File Size Limit

To increase upload size limit in tomcat edit webapps/manager/WEB-INF/web.xml configuration file and search for below content.
# cd /path/to/tomcat
# vim webapps/manager/WEB-INF/web.xml
  <multipart-config>
  
      <max-file-size>52428800</max-file-size>
      <max-request-size>52428800</max-request-size>
      <file-size-threshold>0<</file-size-threshold>
   
  </multipart-config>
  
Edit max-file-size and max-request-size and increase it as your requirement. These values are defined in bytes and the default value is set to 50Mb.
After making all above changes, You need to restart Tomcat instance.

0 comments:

Post a Comment

FIND US ON FACEBOOK

FIND US ON Twitter