struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vic Cekvenich <vic_cekven...@baseBeans.com>
Subject Re: File Upload size restriction ??
Date Mon, 30 Jun 2003 10:44:40 GMT
Try this API.
http://www.servlets.com/cos/index.html
.V

Nicolas De Loof wrote:

>In fact I've got this strange behaviour :
>
>- Form-bean is validated a first time. MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED
is setted and an
>ActionError is returned by validate().
>
>- browser go on uploading for a long time ... (5 minutes for 10Mo upload on localhost)
>
>- validate is called A SECOND TIME.
>MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED is setted and an ActionError is
returned by validate().
>
>- browser show errors.
>
>
>My code looks like Struts upload example. I certainly not understood something !
>
>Nico.
>
>
>
>  
>
>>I'm using fileupload too and have difficulties to send errors about file size.
>>
>>Are you able to send an error message with this code ?
>>
>>In my application validate method returns errors (I can see it in logs) when file
is too large, but browser does'nt
>>display error JSP (waintg ...). I thing it is waiting for the file to be uploaded
or something like this.
>>
>>I'm using tomcat 4.1.24 an IE 6 on Windows 2000.
>>
>>Nico.
>>
>>
>>    
>>
>>>Uups,
>>>
>>>found the answer in one of the strus-examples.
>>>
>>>Here it is for those who are interested.
>>>
>>>Regards
>>>
>>>Markus
>>>
>>>
>>>
>>>
>>>  /**
>>>      * Check to make sure the client hasn't exceeded the maximum
>>>allowed upload size inside of this
>>>      * validate method.
>>>      */
>>>     public ActionErrors validate(ActionMapping mapping,
>>>HttpServletRequest request)
>>>     {
>>>         ActionErrors errors = null;
>>>         //has the maximum length been exceeded?
>>>         Boolean maxLengthExceeded = (Boolean)
>>>
>>>request.getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);
>>>         if ((maxLengthExceeded != null) &&
>>>(maxLengthExceeded.booleanValue()))
>>>         {
>>>             errors = new ActionErrors();
>>>             errors.add(ERROR_PROPERTY_MAX_LENGTH_EXCEEDED, new
>>>ActionError("maxLengthExceeded"));
>>>         }
>>>         return errors;
>>>
>>>     }
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>    
>>

-- 
Vic Cekvenich,
Struts Instructor,
1-800-917-JAVA

Advanced <a href ="baseBeans.com">Struts Training</a> and project recovery in
North East.
Open Source <a href ="baseBeans.com">Content Management</a>  basicPortal sofware
Best practice<a href ="baseBeans.com">Struts Support</a> v.1.1 helper ScafflodingXPress




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


Mime
View raw message