commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Cooper <>
Subject Re: [FileUpload] Exception during request parsing
Date Thu, 17 Nov 2005 22:09:18 GMT
On 11/17/05, Belot Thomas <> wrote:
> Thank you for your answers Martin, here's my response :
> >Because that would limit it to JDK 1.4 or later.
> Ok, now I understand why.
> >The most common cause of this is that the request has already been
> consumed,
> >and is therefore no longer available for parsing by FileUpload.
> >Because it didn't open it. Whoever opened it should close it.
> No, FileUpload is the only one accessing request.getInputStream() in my
> code (by the way I didn't knew that one could use the InputStream before
> giving it to file upload without crashing fileUpload.parse).
> That's why I assumed file upload was supposed to close it.

What I mean is that, for Tomcat at least, getInputStream() does not open the
input stream, it simply returns one that was already open. The container
opens it, so the container should be closing it. (And no, you can't do
anything with the input stream before FileUpload parses it.)

Martin Cooper

Best regards
> Thomas
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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