You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Sayre <ri...@gmail.com> on 2008/03/19 17:42:25 UTC
File Upload Size
I set the file upload max size in the struts.properties to 15MB. When
I upload a file over 15MB my action returns input. Is there any way I
can check to see if the file is over the max size set in the
properties file and handle what result I want to happen myself? I
seems that it returns input before it even goes into my action. Is
this happening in the file upload interceptor? Can I gain more
control over this?
Thank you,
Rich
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: File Upload Size
Posted by Lukasz Lenart <lu...@googlemail.com>.
Hi,
You can subclass FileUploadInterceptor and override acceptFile(File
file, String contentType, String inputName, ValidationAware
validation, Locale locale) method
Regards
--
Lukasz
http://www.linkedin.com/in/lukaszlenart
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: File Upload Size
Posted by Lukasz Lenart <lu...@googlemail.com>.
> No it doesn't
Maybe that's the problem, FileUploadInterceptor check if action
implements it and add error messages. If you implement it, remember to
add result name=input.
Regards
--
Lukasz
http://www.linkedin.com/in/lukaszlenart
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: File Upload Size
Posted by Richard Sayre <ri...@gmail.com>.
No it doesn't
On Wed, Mar 19, 2008 at 2:14 PM, Lukasz Lenart
<lu...@googlemail.com> wrote:
> Does your action implements ValidationAware interface?
>
>
>
>
>
> Regards
> --
> Lukasz
>
> http://www.linkedin.com/in/lukaszlenart
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: File Upload Size
Posted by Lukasz Lenart <lu...@googlemail.com>.
Does your action implements ValidationAware interface?
Regards
--
Lukasz
http://www.linkedin.com/in/lukaszlenart
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: File Upload Size
Posted by Richard Sayre <ri...@gmail.com>.
The reason I am asking this is bacuase when I upload a file over 15MB
I get "no result mapped for INPUT" exception in my error log. When I
do map a result for input the app hangs. I looked at the file upload
in the struts showcase and it returns an error message when the file
you upload is too big. I checked the source and I could not find
where this is being implemented. I have <s:fielderror/> on my page
which i return input to, but as I said earlier my upload action is
hanging.
On Wed, Mar 19, 2008 at 1:12 PM, Richard Sayre <ri...@gmail.com> wrote:
> I set the file upload max size in the struts.properties to 15MB. When
> I upload a file over 15MB my action returns input. Is there any way I
> can check to see if the file is over the max size set in the
> properties file and handle what result I want to happen myself? I
> seems that it returns input before it even goes into my action. Is
> this happening in the file upload interceptor? Can I gain more
> control over this?
>
> Thank you,
>
> Rich
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org