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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
