commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Cooper <>
Subject Re: [FileUpload] - parsing request two times fails.
Date Wed, 17 Mar 2004 05:16:31 GMT
On Wed, 17 Mar 2004, Antony Paul wrote:

> Hi all,
>     I am using commons fileupload 1.0 to upload files. The same page have
> some text fields. To get the values when the request is again parsed it
> returns nothing. It seems that once the request is parsed it clears the
> InputStream obtained from request. I am working Tomcat 4.1.27. Am I right. I
> didnt find any document on this on Googling. I will be grateful if anyone
> clarify my doubts. Is there any way to make a copy of request before it is
> parsed so that original request can be used again.

Yes, that is expected behaviour. The stream being parsed is coming from
the client, and is not stored anywhere in the interim, so once it's been
consumed, you can't process it again. (This is standard servlet behaviour,
and not specific to FileUpload.)

I suppose, if you really wanted to process it twice, you could stream the
incoming data to disk, and then process it from there as many times as you
need to.

Martin Cooper

> rgds
> Antony Paul.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message