views:

530

answers:

1

I have a scenario in which need to calculate the Server Time for uploading files as per the Connection speed.

Example:

Need to calculate time to upload files with Connection speed 256Kbps and more If connection breaks then checking the remaining time and restart the download or upload operation where it was break

+2  A: 

256 Kbps = 32 kilobyte per second = 32768 bytes / s.

The size of your file is x bytes. So it takes (x / 32768) seconds.

If the connection is broken, you should query what was the last byte received by the receiver, put your filestream tot that position and continue.

Henri
Can you elaborate the same, I know the logic but dont know how to apply. Its good if you will supply the asp.net C# code. To calculate elapsed time, remaining time etc.
Rick