Re: count number of downloads
| From: | Richard Lynch | Date: | Thu, 11 Jul 2002 09:32:29 +0000 |
| Subject: | Re: count number of downloads | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-107080@lists.php.net to get a copy of this message | ||
>I have a php-script with which one can download a file with a specific format
>like this:
>
> header("Content-type: application/specific");
> header("Content-Disposition: attachment; filename=$name.sqrfld");
> echo ("output funny stuff...");
>
>and i will count the number of downloads in a database. When i write the code
>for counting after the "echo ..." statement it will be executed regardless if
>the user aborted the download or not. How can i guarantee that i update the
>database when the download is complete?
Don't think you *CAN* be 100% certain the download succeeded...
You can dink around with ignore_user_abort (or not) and friends to *maybe*
improve accuracy, but you'll never get 100%...
--
Like Music? http://l-i-e.com/artists.htm
Off-Topic: What is the moral equivalent of 'cat' in Windows?