On 11/17/05, Belot Thomas <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>