Today while deploying a war file (development site code) in Tomcat 8, I faced the following issue regarding upload limit size in Apache Tomcat server. So I decided to increase limit Tomcat upload file size limit to higher than the default. The default upload limit is set to 50 MB.
Increasing Upload Size Limit
You can increase the Tomcat server upload file size limit by the editing webapps/manager/WEB-INF/web.xml configuration file and searching for the 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>
Also, see the below screenshot.
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 50 MB. You can set the following value for-
- 100 MB => 104857600
- 200 MB => 209715200
Save the file and restart the Tomcat server to reload the changed settings.
8 Comments
Here iam not able 2 see any manager folder in webapps? I need to increase the limit size fro 50mb to 100mb.
Kindly help
how can i alter when i run in STS..spring boot application?
I get below log
org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (74373986) exceeds the configured maximum (10485760)
at org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.(FileUploadBase.java:808) ~[tomcat-embed-core-9.0.16.jar:9.0.16]
at org.apache.tomcat.util.http.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:256) ~[tomcat-embed-core-9.0.16.jar:9.0.16]
at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:280) ~[tomcat-embed-core-9.0.16.jar:9.0.16]
at org.apache.catalina.connector.Request.parseParts(Request.java:2846) ~[tomcat-embed-core-9.0.16.jar:9.0.16]
at org.apache.catalina.connector.Request.getParts(Request.java:2754) ~[tomcat-embed-core-9.0.16.jar:9.0.16]
Hi ,
your sample code as below
52428800
52428800
0<
you have one more “<" in the tag of file-size-threshold
thanks for your sharing.
Thanks Yo
Thnx, this solve the problem.
how to set the uploads size in tomcat server
I was having issues with our server uploading .war file and this helped. THANK YOU
little error : 0<
see: <<