tags:

views:

363

answers:

1

Hi All,

I have written an application using Struts2 for File Upload and want to override the default maxFileSize of 2MB. This is what I have in my strus.xml file:

2000000000 image/jpeg,image/gif,image/png dojo..,^struts.. input,back,cancel,browse input,back,cancel,browse

    <action name="upload" class="uk.co.jdw.fileUpload.actions.FileUploadAction">
        <interceptor-ref name="fileUploadStack" />
        <result name="input">pages/fileUpload.jsp</result>
        <result>pages/fileUploadSuccess.jsp</result>
    </action>


and this is what I have put in struts.properties file (in WEB-INF/class folder) :

struts.multipart.maxSize=50000000000

So, as per the information what I found online, I'm keeping the parser maxSize greater than fileUpload Interceptor maximumSize.


Besides these two, I also have maxSize configured in a separate properties file set to 2000000000, and read that properties file in the validate() method in my action class, and display some configured error messages on the form page.

Even with all these settings, when I try uploading a file of around 3 MB, it throws some internal error message:

"the request was rejected because its size (4054646) exceeds the configured maximum (2097152)"..

Could anyone please suggest if I'm doing anythin wrong or any changes required ?

Any comments will be appreciated.

Thanks.

A: 

Did you find a solution? Been banging my head on this all day

Kris