You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by David Holroyd <da...@badgers-in-foil.co.uk> on 2006/01/31 10:02:31 UTC

[fileupload] Efficient upload stream reading API?

All,

The current FileUpload API only allows uploaded data to be read by the
application if an intermediate buffer (i.e. DiskFileItem) is used.  It
would be very handy if the low-level interfaces provided read access to
the uploaded file data.

Currently, the API provided by MultipartStream is in terms of an
OutputStream,

  int readBodyData(OutputStream output)


I am proposing the addition of a method like,

  InputStream readBodyData()


I've started hacking together some code to add this functionality, and
to re-implemented the original readBodyData(OutputStream) method
in terms of this using IOUtils.copy(int, out).

Would a patch along these lines be accepted?


thanks,
dave

-- 
http://david.holroyd.me.uk/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: Efficient upload stream reading API?

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On Wed, 2006-02-08 at 13:30 +0000, David Holroyd wrote:
> Hiya,
> 
> Have I made a procedural misstep in attempting to discuss this here
> (i.e. I should have used bugzilla?) or is everyone just really busy?

everyone is always really busy ;) 

but please don't let that stop you: it sometimes takes a little while to
attract attention but things usually get a little easier once
communication has been established.

you can increase the chances of one of the committers involved with
fileupload picking up your comments by prefixing with the component
name. most developers filter their on the prefix. see
http://wiki.apache.org/jakarta-commons/JakartaCommonsEtiquette.

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: Efficient upload stream reading API?

Posted by David Holroyd <da...@badgers-in-foil.co.uk>.
Hiya,

Have I made a procedural misstep in attempting to discuss this here
(i.e. I should have used bugzilla?) or is everyone just really busy?

...

On Tue, Jan 31, 2006 at 09:02:31AM +0000, David Holroyd wrote:
> All,
> 
> The current FileUpload API only allows uploaded data to be read by the
> application if an intermediate buffer (i.e. DiskFileItem) is used.  It
> would be very handy if the low-level interfaces provided read access to
> the uploaded file data.
> 
> Currently, the API provided by MultipartStream is in terms of an
> OutputStream,
> 
>   int readBodyData(OutputStream output)
> 
> 
> I am proposing the addition of a method like,
> 
>   InputStream readBodyData()
> 
> 
> I've started hacking together some code to add this functionality, and
> to re-implemented the original readBodyData(OutputStream) method
> in terms of this using IOUtils.copy(int, out).
> 
> Would a patch along these lines be accepted?


dave

-- 
http://david.holroyd.me.uk/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [fileupload] Efficient upload stream reading API?

Posted by David Holroyd <da...@badgers-in-foil.co.uk>.
I'm unsubscribing from this list for the time being, but would still
love to see a comment (either way) on:

  http://issues.apache.org/bugzilla/show_bug.cgi?id=38623


thanks!
dave


On Tue, Jan 31, 2006 at 09:02:31AM +0000, David Holroyd wrote:
> All,
> 
> The current FileUpload API only allows uploaded data to be read by the
> application if an intermediate buffer (i.e. DiskFileItem) is used.  It
> would be very handy if the low-level interfaces provided read access to
> the uploaded file data.
> 
> Currently, the API provided by MultipartStream is in terms of an
> OutputStream,
> 
>   int readBodyData(OutputStream output)
> 
> 
> I am proposing the addition of a method like,
> 
>   InputStream readBodyData()
> 
> 
> I've started hacking together some code to add this functionality, and
> to re-implemented the original readBodyData(OutputStream) method
> in terms of this using IOUtils.copy(int, out).
> 
> Would a patch along these lines be accepted?

-- 
http://david.holroyd.me.uk/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [fileupload] Efficient upload stream reading API?

Posted by David Holroyd <da...@badgers-in-foil.co.uk>.
Hi again, are any of the FileUpload team around?..

On Tue, Jan 31, 2006 at 08:14:27PM +0000, David Holroyd wrote:
> On Tue, Jan 31, 2006 at 09:02:31AM +0000, David Holroyd wrote:
> > The current FileUpload API only allows uploaded data to be read by the
> > application if an intermediate buffer (i.e. DiskFileItem) is used.  It
> > would be very handy if the low-level interfaces provided read access to
> > the uploaded file data.

My last patch was buggy.  This one is better.


ta,
dave

-- 
http://david.holroyd.me.uk/

Re: [fileupload] Efficient upload stream reading API?

Posted by David Holroyd <da...@badgers-in-foil.co.uk>.
Hi again,

On Tue, Jan 31, 2006 at 09:02:31AM +0000, David Holroyd wrote:
> The current FileUpload API only allows uploaded data to be read by the
> application if an intermediate buffer (i.e. DiskFileItem) is used.  It
> would be very handy if the low-level interfaces provided read access to
> the uploaded file data.

The attached patch tries to get this working (though without much
thought yet for efficiency or compliance with the existing
code-formatting standards ;).

The changed code passes the ServletFileUploadTest suite, and adds a
test-suite for the new DelimitedInputStream class.

Is there any chance of a future release of FileUpload supporting this
kind of interface?


ta,
dave

-- 
http://david.holroyd.me.uk/