今天在做post方式文件上传的的时候,大于5M的文件怎么也传不上去,分析了几个地方,最后发现原来是tomcat容器的限制,post的最大值有限制,修改为maxPostSize =-1
As per http://tomcat.apache.org/tomcat-6.0-doc/config/http.html the default is 2 MB for your<Connector>
.
maxPostSize = The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than or equal to 0. If not specified, this attribute is set to 2097152 (2 megabytes).
Edit Tomcat's server.xml. In the <Connector>
element, add an attribute maxPostSize
and set a larger value (in bytes) to increase the limit.
Having said that, if this is the issue, you should have got an exception on the lines of Post data too big
in tomcat