I have a download manger that allows visitors a certen number of times they can download a file. My question is this, is there a way to detect that they have actually downloaded a file rather than just attemped to download the file? (In other words, when the download completed it counts as a download rather than when they click on the download link it counts as a download.)
I am using a basic this method to send the files to the browser:
$currnet_count++; open(FILE2, "$file") or die "Can't open $file: $!\n"; print "Content-Type: application/unknown\n"; print "Content-Disposition: attachment; filename=$filename\n"; print "Content-Length: $filesize\n\n"; while (<FILE2>) { print; } close(FILE2);
Perhaps there is way to read how many bytes are sent and compare it to the file size. But then if a download had been ended for any reason the bytes would not total right. So maybe a way to determind if it is the last byte.
In reply to download attempted vs completed by etzel42
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |