hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Brown" <chris92...@hotmail.com>
Subject Real-time feedback about upload progress
Date Wed, 17 Nov 2004 13:36:38 GMT
Hi all,

It's funny that I found myself helping out with real-time downloading 
feedback... I'm implementing it right now using HttpClient 3.0-alpha.  BUT, 
now I've stumbled across a problem...  The reverse, in fact!  I need to 
provide feedback on UPLOADING!

RequestEntity doesn't seem to provide me with any way to see how much of a 
stream has been sent to the server.  In InputStreamRequestEntity, for 
example, I can provide the input stream, and then execute the 
Post/PutMethod... and have control again when it's all done.

Am I right so far?  Is there no way to get feedback on how much data has 
been sent?

Assuming that you CAN'T get this feedback, I consider this an important 
feature to add for the 3.0 release (I'm not sure I can contribute anything 
more than an idea at the moment...).  Here's some ideas :

* modify RequestEntity so that can add a "Listener"-style interface for 
notifying some class each time one byte or a block of bytes has been 
transferred, something like

  interface RequestEntityMonitor
    void bytesTransferred(int numberOfBytes);

* create some sort of FilterInputStream that can wrap any other InputStream, 
providing the above functionality.  This would be more light-weight than the 
above approach (no overhead for those that don't need this feature).

Can you confirm if I'm correct, and maybe let me know what you think of my 
suggestions (helpful comments only please!).

- Chris

MSN Hotmail : antivirus et antispam intégrés 

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

View raw message