tags:

views:

14

answers:

1

Howdy,

I'm writing a little Java client side app which uploads things using http streams to remote servers, i've included a progress bar to provide the user with an estimate of completion. Currently the program sends a small file to a remote server and calculates the upstream bitrate based on the filesize/total transfer time. I'm wondering if there is a more elegant way to do this? Any thoughts/tips?

Thanks

A: 

If you had to write the loop that writes bytes to the outgoing HTTP stream, you can add a count of bytes transferred and update it at the end of each loop iteration. Then just add a progress bar like that.

bod