Diez B. Roggisch
1/12/2008 1:19:00 PM
whatazor schrieb:
> 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