Thanks to this forum, I have built the code to download files and resume broken downloads (http Accept/Range stuff).
Currently access to downloads is controlled by a timer.
I'd prefer to allow unlimited time, but shut off access once the download is complete.
Anyone know of a way to do it? How do we know if all bytes were received?
Currently:
if DownloadFile("blah")
logging("download complete")
DownloadFile($filename) {
//set http range headers etc
...
fpassthru($fp);
return true;
}
I get the log entry seconds after the download starts (php create another process to do it?). Same with seek... echo fread($fp,$sendSize) instead of fpassthru.
If the download is paused and resume 3 times, I get 3 log entries. Maybe the customer got the file, maybe not.
I can tell what I sent. Can I tell what was received?
Many thanks in advance.