You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Frank Russo <Fr...@sas.com> on 2009/07/08 22:39:17 UTC

How is the max file size controlled for file uploads in Struts 1.3.8?

Can it be changed?

----------------------------------------------------------------------------------------------------------------
Frank Russo
Developer ▪ Financial Services Division
SAS® … THE POWER TO KNOW®



RE: How is the max file size controlled for file uploads in Struts 1.3.8?

Posted by Frank Russo <Fr...@sas.com>.
I guess the main problem is that the request params are gone. So not only if the file not submitted, but none of the params are submitted. The rest of the params need to be made available, imo...

----------------------------------------------------------------------------------------------------------------
Frank Russo
Developer ▪ Financial Services Division
SAS® … THE POWER TO KNOW®


-----Original Message-----
From: paulus.benedictus@gmail.com [mailto:paulus.benedictus@gmail.com] On Behalf Of Paul Benedict
Sent: Saturday, October 03, 2009 9:20 PM
To: Struts Users Mailing List
Subject: Re: How is the max file size controlled for file uploads in Struts 1.3.8?

Frank,

Do you prefer an exception? What would you do with it?

Paul

On Thu, Jul 9, 2009 at 8:17 AM, Frank Russo <Fr...@sas.com> wrote:
> org.apache.struts.util.RequestUtils has the following at lines 408-415:
>
>                Boolean maxLengthExceeded =
>                    (Boolean) request.getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);
>
>                if ((maxLengthExceeded != null)
>                    && (maxLengthExceeded.booleanValue())) {
>                    ((ActionForm) bean).setMultipartRequestHandler(multipartHandler);
>                    return;
>                }
>
> Why would it just return? Shouldn't it throw some kind of exception? When my action is called, I have no way to know that the max file size was exceeded, and my request params are empty, so the correct DispatchAction method isn't being called.
>
> Has anyone else seen this behavior?
>
> ----------------------------------------------------------------------------------------------------------------
> Frank Russo
> Developer ▪ Financial Services Division
> SAS® … THE POWER TO KNOW®
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



Re: How is the max file size controlled for file uploads in Struts 1.3.8?

Posted by Paul Benedict <pb...@apache.org>.
Frank,

Do you prefer an exception? What would you do with it?

Paul

On Thu, Jul 9, 2009 at 8:17 AM, Frank Russo <Fr...@sas.com> wrote:
> org.apache.struts.util.RequestUtils has the following at lines 408-415:
>
>                Boolean maxLengthExceeded =
>                    (Boolean) request.getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);
>
>                if ((maxLengthExceeded != null)
>                    && (maxLengthExceeded.booleanValue())) {
>                    ((ActionForm) bean).setMultipartRequestHandler(multipartHandler);
>                    return;
>                }
>
> Why would it just return? Shouldn't it throw some kind of exception? When my action is called, I have no way to know that the max file size was exceeded, and my request params are empty, so the correct DispatchAction method isn't being called.
>
> Has anyone else seen this behavior?
>
> ----------------------------------------------------------------------------------------------------------------
> Frank Russo
> Developer ▪ Financial Services Division
> SAS® … THE POWER TO KNOW®
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: How is the max file size controlled for file uploads in Struts 1.3.8?

Posted by Frank Russo <Fr...@sas.com>.
org.apache.struts.util.RequestUtils has the following at lines 408-415:

                Boolean maxLengthExceeded =
                    (Boolean) request.getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);

                if ((maxLengthExceeded != null)
                    && (maxLengthExceeded.booleanValue())) {
                    ((ActionForm) bean).setMultipartRequestHandler(multipartHandler);
                    return;
                }

Why would it just return? Shouldn't it throw some kind of exception? When my action is called, I have no way to know that the max file size was exceeded, and my request params are empty, so the correct DispatchAction method isn't being called. 

Has anyone else seen this behavior?

----------------------------------------------------------------------------------------------------------------
Frank Russo
Developer ▪ Financial Services Division
SAS® … THE POWER TO KNOW®


-----Original Message-----
From: paulus.benedictus@gmail.com [mailto:paulus.benedictus@gmail.com] On Behalf Of Paul Benedict
Sent: Wednesday, July 08, 2009 9:16 PM
To: Struts Users Mailing List
Subject: Re: How is the max file size controlled for file uploads in Struts 1.3.8?

Struts 1.3 does control when the file upload size hits a limit. The
<controller> element has a @maxFileSize attribute:

http://applegrew.blogspot.com/2008/10/struts-1-config-file-reference.html

Paul

2009/7/8 Martin Gainty <mg...@hotmail.com>:
>
> FileUploadInterceptor has a setMaximumSize(Long size) method
>
> http://struts.apache.org/2.1.2/struts2-core/apidocs/org/apache/struts2/interceptor/FileUploadInterceptor.html
>
> hth
> Martin
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>
>
>
>
>> From: Frank.Russo@sas.com
>> To: user@struts.apache.org
>> Date: Wed, 8 Jul 2009 16:39:17 -0400
>> Subject: How is the max file size controlled for file uploads in Struts 1.3.8?
>>
>> Can it be changed?
>>
>> ----------------------------------------------------------------------------------------------------------------
>> Frank Russo
>> Developer ▪ Financial Services Division
>> SAS® … THE POWER TO KNOW®
>>
>>
>
> _________________________________________________________________
> Windows Live™: Keep your life in sync.
> http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



RE: How is the max file size controlled for file uploads in Struts 1.3.8?

Posted by Martin Gainty <mg...@hotmail.com>.
i couldnt locate the 1.3.8 distro..i was assumining EOLed?

also there was no maxFileSize available in 2.1.6 tree?
could you confirm that maxFileSize was dropped or deprecated?

in the meanwhile struts2 users try specifying MaximumSize as a interceptor=ref param e.g.
<interceptors>
<interceptor name="fileUpload" class="org.apache.struts2.interceptor.FileUploadInterceptor"/>
</interceptor>

           <interceptor-stack name="fileUploadStack">
            <interceptor-ref name="FileUploadInterceptor"><param name="MaximumSize">128000</param>
            </interceptor-ref>
           </interceptor-stack>

thanks again for the update
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Wed, 8 Jul 2009 20:15:54 -0500
> Subject: Re: How is the max file size controlled for file uploads in Struts 	1.3.8?
> From: pbenedict@apache.org
> To: user@struts.apache.org
> 
> Struts 1.3 does control when the file upload size hits a limit. The
> <controller> element has a @maxFileSize attribute:
> 
> http://applegrew.blogspot.com/2008/10/struts-1-config-file-reference.html
> 
> Paul
> 
> 2009/7/8 Martin Gainty <mg...@hotmail.com>:
> >
> > FileUploadInterceptor has a setMaximumSize(Long size) method
> >
> > http://struts.apache.org/2.1.2/struts2-core/apidocs/org/apache/struts2/interceptor/FileUploadInterceptor.html
> >
> > hth
> > Martin
> > ______________________________________________
> > Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
> >
> > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> > Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> >
> >
> >
> >
> >> From: Frank.Russo@sas.com
> >> To: user@struts.apache.org
> >> Date: Wed, 8 Jul 2009 16:39:17 -0400
> >> Subject: How is the max file size controlled for file uploads in Struts 1.3.8?
> >>
> >> Can it be changed?
> >>
> >> ----------------------------------------------------------------------------------------------------------------
> >> Frank Russo
> >> Developer ▪ Financial Services Division
> >> SAS® … THE POWER TO KNOW®
> >>
> >>
> >
> > _________________________________________________________________
> > Windows Live™: Keep your life in sync.
> > http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Windows Live™ SkyDrive™: Get 25 GB of free online storage.
http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009

Re: How is the max file size controlled for file uploads in Struts 1.3.8?

Posted by Paul Benedict <pb...@apache.org>.
Struts 1.3 does control when the file upload size hits a limit. The
<controller> element has a @maxFileSize attribute:

http://applegrew.blogspot.com/2008/10/struts-1-config-file-reference.html

Paul

2009/7/8 Martin Gainty <mg...@hotmail.com>:
>
> FileUploadInterceptor has a setMaximumSize(Long size) method
>
> http://struts.apache.org/2.1.2/struts2-core/apidocs/org/apache/struts2/interceptor/FileUploadInterceptor.html
>
> hth
> Martin
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>
>
>
>
>> From: Frank.Russo@sas.com
>> To: user@struts.apache.org
>> Date: Wed, 8 Jul 2009 16:39:17 -0400
>> Subject: How is the max file size controlled for file uploads in Struts 1.3.8?
>>
>> Can it be changed?
>>
>> ----------------------------------------------------------------------------------------------------------------
>> Frank Russo
>> Developer ▪ Financial Services Division
>> SAS® … THE POWER TO KNOW®
>>
>>
>
> _________________________________________________________________
> Windows Live™: Keep your life in sync.
> http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: How is the max file size controlled for file uploads in Struts 1.3.8?

Posted by Martin Gainty <mg...@hotmail.com>.
FileUploadInterceptor has a setMaximumSize(Long size) method

http://struts.apache.org/2.1.2/struts2-core/apidocs/org/apache/struts2/interceptor/FileUploadInterceptor.html

hth
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> From: Frank.Russo@sas.com
> To: user@struts.apache.org
> Date: Wed, 8 Jul 2009 16:39:17 -0400
> Subject: How is the max file size controlled for file uploads in Struts 1.3.8?
> 
> Can it be changed?
> 
> ----------------------------------------------------------------------------------------------------------------
> Frank Russo
> Developer ▪ Financial Services Division
> SAS® … THE POWER TO KNOW®
> 
> 

_________________________________________________________________
Windows Live™: Keep your life in sync. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009