On Sun, Jun 14, 2009 at 1:49 AM, Wes Wannemacher <w...@wantii.com> wrote:
> On Saturday 13 June 2009 10:34:53 pm tatan123 wrote: > > We want to restrict the file upload size to 2 MB. While doing testing it > > seems we can upload a 100 MB file, after that struts2 showing message > that > > the uploaded file exceeds the max file size limit. Is there any way > struts2 > > can show the error message without full file upload... > > > > Thanks > > I could be wrong, but if you are talking about the temp file generated as > the > upload takes place, then you might be better off setting the max post size > of > your application server. In Tomcat, you can use the maxPostSize attribute > of > the connector element. > > -Wes > -- > > > I don't think the Tomcat maxPostSize attribute applies to file uploads. Here is what the Tomcat 5.5 docs say: 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). I've never set this attribute and have been able to upload 20mb files.