Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Web Servers»Tomcat»How to Increase Tomcat Upload File Size Limit

    How to Increase Tomcat Upload File Size Limit

    By RahulJanuary 27, 20231 Min Read

    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.

    Advertisement

    Caused by: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException the request was rejected because its size (128382112) exceeds the configured maximum (104828800)

    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.

    Increase tomcat upload file size limit

    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.

    filesize limit tomcat upload
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Find Tomcat Version

    How to Check Tomcat Version on Linux

    How to Install Tomcat 10 on Debian 10

    How to Install Tomcat 10 on Debian 11/10

    How to Install Let's Encrypt SSL on Tomcat

    How To Secure Tomcat with Let’s Encrypt SSL

    View 8 Comments

    8 Comments

    1. Satya Prakash on March 9, 2021 4:14 am

      Here iam not able 2 see any manager folder in webapps? I need to increase the limit size fro 50mb to 100mb.
      Kindly help

      Reply
    2. Navin on March 2, 2019 5:05 am

      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]

      Reply
    3. Yo on August 31, 2018 3:44 am

      Hi ,

      your sample code as below

      52428800
      52428800
      0<

      you have one more “<" in the tag of file-size-threshold

      thanks for your sharing.

      Reply
      • Rahul K. on August 31, 2018 7:07 am

        Thanks Yo

        Reply
    4. hh on August 27, 2018 4:57 pm

      Thnx, this solve the problem.

      Reply
    5. jeeva on July 25, 2018 11:57 am

      how to set the uploads size in tomcat server

      Reply
    6. glen on April 18, 2018 5:55 pm

      I was having issues with our server uploading .war file and this helped. THANK YOU

      Reply
    7. name on February 2, 2018 9:00 am

      little error : 0<
      see: <<

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.