
On Tue, Sep 22, 2009 at 10:53 AM, Arthur Buliva <abuliva@mobileplanet.co.ke> wrote:
This is what I mean; Suppose I have a file on localhost that can be downloaded by visiting http://localhost/service/file.zip. The file.zip is 123456 bytes long. If someone downloads it completely, then I expect that 123456 bytes to have been transferred. Suppose someone cancels mid-way, or an error occurs, then there is a log to show that file transfer was not complete.
You probably need a script to proxy the downloads - channel all downloads through this proxy script. in the script you ll need to do something like this : 1 - get the size of the requested file 2 - read the file and write the contents of the file as binary into the output stream 3 - when the script completes compare the output no. of bytes with the original byte size (from step 1 ) 4 - write success / failure of the download to a log file depending on wether the comparison was equal or not in step 3