hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: visualizing upload/download status in a statusbar
Date Fri, 26 Sep 2008 18:48:32 GMT
On Fri, 2008-09-26 at 11:22 +0200, Marcel Schiffel wrote:
> Hi,
> 
> we're successfully using the HttpClient library for several months now, but
> now we need a feature that seems quite hard to implement: Sometimes we need
> to transmit large files (up to serveral Mb) and therefore have to give some
> feedback about the up- or download status to the user. Unfortunately i
> haven't found any information on this.
> 
> When downloading a file I tried to tell the client the content size by
> setting a response header and then count each byte that is read from the
> input stream. Unfortunately I still have the feeling that the whole file is
> transmitted and I get an InputStream on the result afterwards. When
> uploading a file I'm using method.setRequestEntity(new
> ByteArrayRequestEntity(content)); and therefore can't even count the
> individual bytes.
> 
> Is there an event listener that I can register to get notified whenever
> another percent of the file transmitted? Is it even possible to implement it
> using HttpClient and where can I find some information on this issue (maybe
> even sample code)?
> 
> many thanks in advance
> Marcel

Marcel,

I have to be very brief. You need to decorate the OutputStream instance
with a wrapper class that counts bytes sent and fires notifications.

I can give you a more detailed answer when I am back from vacation in 10
days.

Oleg



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


Mime
View raw message