Is there a way to not only check how many users have clicked the download link, but actually know if they finished it or not? (Other than going into the server log)
Probably.
Haha. I would be grateful if someone took the time and explained how this would be done.
I doubt it. In any event, it's a non-trivial problem, so I doubt anyone will do the research for you! If you find a way, it would be interesting to hear about it.
Its probably possible using some combination of fpassthru and connection_aborted. Actually theres a comment in the docs for fpassthru that appear to be capable of doing what you want. http://www.php.net/fpassthru
Neat :)
That will cause more problems than it's worth, trust me - especially for large files.
Use fread instead of fpassthru if this is absolutely necessary:
<?phpwhile (!feof($res)) {$buffer = fread($res, 2048);echo $buffer;$bytessent+=strlen($buffer);}if ($bytessent == filesize($file)) {// File completed downloading.}?>
This will severely impact performance (though not nearly as much as fpassthru) if your website is high-traffic.