upload file and estimation time

W

whatazor

Hi all,
unseccsefully, I try to analyze this problem. If I can only work on
the client size, how can I create a module that calculate the upload
time of a file, so the time for finish it? i can start with ftp
protocol and after extend this logic for my requirements.

thx

w
 
D

Diez B. Roggisch

whatazor said:
Hi all,
unseccsefully, I try to analyze this problem. If I can only work on
the client size, how can I create a module that calculate the upload
time of a file, so the time for finish it? i can start with ftp
protocol and after extend this logic for my requirements.

All you need to to is to

- count the number of bytes to transfer, U

- count the bytes already transfered, u

- measure the time since the upload, t



Then the ETA is

eta = (u / t) * (U - u)

Using the ftp-lib, you best pass a file-wrapper that overload the
read-method to accumulate the read bytes to yield u.

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top