commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Cooper <>
Subject Re: [FileUpload] parsing part of a request
Date Tue, 10 Jun 2003 00:50:05 GMT

On Mon, 9 Jun 2003, Cindy Ballreich wrote:

> In the event that the parseRequest(request) method of DiskFileUpload throws an exception
(FileUploadBase.SizeLimitExceededException for example), is there a way to reject the FileItem
that caused the exception and finish parsing the rest of the request so that the other FileItems
can be retrieved (especially the FormFields)?

If SizeLimitExceededException is thrown, that happens before parsing of
the multipart body even starts, since the size limit is based on the size
of the entire request.

One thing you could do is write your own FileItem implementation that
discards data beyond a configured threshold. This wouldn't solve the
problem of the overall request size, but it would let you control the
maximum size of an individual file item, and continue the parse even if
one or more items exceed the limit. You'd have to set the overall maximum
size high enough so that SizeLimitExceededException would not be
triggered, of course.

Feel free to file an enhancement request in the bug database, and we can
think about it some more for a post-1.0 release.

Martin Cooper

> Thanks
> Cindy
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message