| View previous topic :: View next topic |
kate_cl
Joined: 15 Jan 2009 Posts: 1
|
Posted: Thu Jan 15, 2009 11:01 pm Post subject: Struts 2 override FileUploadInterceptor |
|
|
|
Whenever I upload file with size more than 2MB, it will result on HTTP 500 error page. I found out that Struts 2 default maximum size for file upload is 2MB.So i set the struts.multipart.maxSize to the maximum size that i want..and also define this in my stack
<interceptor-ref name="fileUpload">
5242880
</interceptor-ref>
it works in setting the maximum size according to our needs...but if we upload file more than the maximum size,it will still show the HTTP 500 page..how can i customize it to redirect to previous page n show my own error msg..like "Failed to Upload"
I've tried to extend the FileUploadInterceptor class and override the method acceptFile,but when we upload file exceeding the maximum size,it will never get to my new method..been cracking my brain on this 1 for 4 days already ,hopefully someone have the answer.. |
|
| Back to top |
|
|
|
|
 |
wesw Site Admin
Joined: 13 Jul 2007 Posts: 85 Location: USA
|
Posted: Fri Jan 23, 2009 8:59 am Post subject: |
|
|
|
I'll check into it to be sure, but unless I am mistaken, I don't think you should get an HTTP 500 when the max size is exceeded. I think there are validation errors that you should get. Is the action processing your upload, does it extend ActionSupport? The HTTP 500 might be coming up because the framework is trying to do something that it can't. _________________ Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
Powered by phpBB © 2001, 2002 phpBB Group |
|
|
|
|