I need to upload files upto 10 MB.I used the following .In my struts.xml i configured like as follows.
<action name="doUpload" class="com.example.UploadAction">
<interceptor-ref name="fileUpload">
<param name="maximumSize">20971520</param>
</interceptor-ref>
</action>
I did not configured any where other than this.I am getting the following error.
the request was rejected because its size (2102840) exceeds the configured maximum (2097152)
Can any one suggest me what might be the reason.Thanks in advance.
Put this in your struts.xml file
<constant name="struts.multipart.maxSize" value="30000000" />
See http://struts.apache.org/2.x/docs/file-upload.html#FileUpload-AdvancedConfiguration.
Updated link - https://cwiki.apache.org/confluence/display/WW/File+Upload
Also check your container configuration. Tomcat itself, for example, has a maxPostSize parameter which, if not set defaults to 2097152 (2Mb)
put this code on your strtus.xml:
<constant name="struts.multipart.maxSize" value="50000000" />
where value denotes your file size limit . if you want to extend the limit you can change the value as well . hope it helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With