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] Exception during request parsing
Date Thu, 17 Nov 2005 16:54:56 GMT
On 11/17/05, Belot Thomas <Thomas.Belot@atosorigin.com> wrote:
>
> Hello everybody, i've got an exception while using :
> DiskFileUpload upload = new DiskFileUpload();
> upload.setSizeMax(getMaxFormSize());
> List items = upload.parseRequest(request);
>
> Exception (fileUpload v1.0):
> org.apache.commons.fileupload.FileUploadException: Processing of
> multipart/form-data request failed. null
> at
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase
> .java:429)
> ....


The most common cause of this is that the request has already been consumed,
and is therefore no longer available for parsing by FileUpload.

I went into the nightly build code source of FileUploadBase and I'm
> wondering a few things :
> 1) Why don't fileupload chain exceptions instead of using sub
> exception's message (which brings the useless null in the log)?
> catch (IOException e)
> {
> throw new FileUploadException(
> "Processing of " + MULTIPART_FORM_DATA
> + " request failed. " + e.getMessage());
> }


Because that would limit it to JDK 1.4 or later.

2) Why don't fileupload close the request InputStream ?
> InputStream input = req.getInputStream();


Because it didn't open it. Whoever opened it should close it.

--
Martin Cooper


Thanks for your attention
>
>
> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

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