commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dakota Jack <dakota.j...@gmail.com>
Subject Re: FileUpoad:
Date Thu, 21 Apr 2005 09:17:33 GMT
By the way, why not put the check before the parse, if I read the code
correctly?

On 4/21/05, Tom Eugelink <tbee@tbee.org> wrote:
> Thanks Dakota,
> 
> The solution was very simple:
> 
> ...
> 
>         // we always want to be able to get the ID
>         // so we do the filesize check ourselves
>          int lRequestSize = request.getContentLength();
>         lFileUpload.setSizeMax(lRequestSize);
> 
> ...
> 
>         lFileItems = lFileUpload.parseRequest(request);
> 
> ...
>         //
>         // manually check the size
>          if (iMaxSize >= 0 && lRequestSize > iMaxSize)
>          {
>                 response.sendRedirect(iOnError + "?id=" + lId);
>                 return;
>          }
> 
> Great help.
> 
> Tom
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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


Mime
View raw message