vicker313 tech blog

August 12, 2010

Increase or Make Unlimited Maximum Post Size in Tomcat

Filed under: Tomcat — Tags: , , — vicker313 @ 7:58 pm

Tomcat by default has limited the amount of data (2 MB) that you can submit to Tomcat Service through Form Post Method. In other word, exception will occur if you upload something more than 2 MB. To increase the maximum post size or make it unlimited, you only need to:

  1. Edit the server.xml file in conf folder
  2. Look for the line (or similar):
    <Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>
  3. Add this attribute: maxPostSize=”o”. Set the value 0 (zero) make it unlimited, or any size like “4MB”. Now it is look like this:
    <Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" maxPostSize="0"/>
  4. Restart Tomcat Service and done
Advertisements

Create a free website or blog at WordPress.com.