Expected time to download a file
Hi,
We have a requirement to download a file. But before downloading the file, we have to show"Expected time to download". As per my
understaning, we need two factors to calculate the expected download time (a) File size (b) Network speed. I don't have any idea to find
network speed. Can any one please help. This is very urgent. Your help will be greatly appreciated.
Thanks in advance.
Regards,
Siddhartha Roy
# 1
You won't know the network bandwidth in advance: it's dynamic. You need to know the file size, and you need to continually measure the progress so far against elapsed time. That will tell you how long it should take from now to completion, where 'now' is dynamic too. The expected download time left will vary over time and it will get more and more accurate as the download proceeds.
Unless you are writing this code in Seattle, then all bets are off ;-)
ejpa at 2007-7-12 8:36:16 >

# 2
Hi,
Thanks for prompt reply. But as per our requirement, we have to show the expected time even before we start download. As per your suggestion, we have to measure the progress continously then how to do it before we start download. Please suggest.
Thanks & Regards,
Siddhartha Roy
# 4
Why not just calculate the time it would take for some common bandwidths (56k, 1Mb, 2Mb, etc...) and display these before the download, that should give users a good indication of how long it will take.
Alternatively you could get the user to input their bandwidth so that an estimation can be made using that.