etzel42 has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: download attempted vs completed
by clinton (Priest) on Mar 22, 2006 at 18:51 UTC | |
|
Re: download attempted vs completed
by codeacrobat (Chaplain) on Mar 22, 2006 at 17:59 UTC | |
by etzel42 (Initiate) on Mar 25, 2006 at 14:31 UTC | |
|
Re: download attempted vs completed
by jdtoronto (Prior) on Mar 22, 2006 at 18:09 UTC | |
|
Re: download attempted vs completed
by superfrink (Curate) on Mar 22, 2006 at 17:55 UTC |