commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <mart...@apache.org>
Subject Re: fileupload sizelimitexception
Date Tue, 30 Sep 2008 16:56:53 GMT
On Tue, Sep 30, 2008 at 9:52 AM, Paul Rivera <paulrivera22@gmail.com> wrote:

> Hi!
>
> Thanks for the quick response.
>
> Yes, I have.  Sorry for the vagueness but let me clear things up a little.
>
> FileUploadBase.parseRequest() returns a List containing FileItem objects.
> These FileItem objects can either be a file uploaded or a form field (these
> form fields are what I need).
>
> In commons fileupload 1.0, FileUploadBase.parseRequest() throws an
> Exception
> if the maxSize is exceeded _before it even starts to read from the
> MultipartStream.  Meaning, it will not even read the first form field.
>
> I've looked into fileupload 1.2.1 and the flow looks pretty much the same.


If you use the streaming mode in 1.2, you should be able to capture the
hidden field before you hit the max size limit.

--
Martin Cooper


I was hoping I could make FileUploadBase.parseRequest() still return the
> form fields (but exclude the data from the uploaded file) even in the case
> when the maxSize is exceeded.
>
> Any ideas?
>
> Best Regards,
> Paul Rivera
>
> On Tue, Sep 30, 2008 at 11:36 PM, F. Andy Seidl <
> faseidl@myst-technology.com
> > wrote:
>
> > Have you tried placing the hidden form field before the upload field in
> the
> > form?
> >  -- fas
> >
> > -----Original Message-----
> > From: Paul Rivera [mailto:paulrivera22@gmail.com]
> > Sent: Tuesday, September 30, 2008 10:02 AM
> > To: user@commons.apache.org
> > Subject: fileupload sizelimitexception
> >
> > Hi!
> >
> > I'm using commons fileupload 1.0.  I'm in a situation wherein:
> >
> >  - if the user submits a file larger than my defined maxFileSize,
> > FileUploadBase throws a SizeLimitExceededException which stops processing
> > of
> > the remaining parameters.
> >  - i have a hidden field in my form that my web application needs to
> > retrieve even in the case of an exceeded size limit.
> >
> > Does anyone have ideas on possible solutions here?
> >
> > I have not yet tried using the latest release, commons-fileupload-1.2.1.
> > But skimming through the code, things look similar.  It looks like the
> > exception will still be thrown before the rest of the parameters get
> read.
> >
> > Best Regards,
> > Paul Rivera
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message