All of the examples on weberdev.com use a download script that
should send the file like you describe. This used to work but now
that I'm testing it, It seems that instead of the file name I get
the script name.htm or something else. The only thing that has
changed is that I upgraded to 4.0.4pl1
any idea?
-----Original Message-----
From: Daniel Grace [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 2:37 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] File Download Completion
"Boaz Yahav" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is it possible to find out if a client finished to DL a file?
>
> Suppose i put a link to a file and people start to DL the file.
> Some people can stop the DL in the middle. I need to know
> how many people completed the DL.
>
> Any simple ideas how to do this?
>
> thanks
>
> berber
>
One option could be to use ignore_user_abort:
<?PHP
ignore_user_abort(0); // Script will be aborted if transfer fails for
whatever reason
?>
blahblahblahyaddityyaddiy yaddity
<?PHP
// If we're this far, it means the file's more or less transferred all the
way.
file_did_download();
?>
Caveats with this:
1. Your file has to be part of the PHP page (though not neccessarily in the
file itself, header("content-type: blah/blah"); combined with
readfile($filename) will do the trick I think.
2. You (probably) can't use programs that are capable of resuming file
transfers. If you can somehow, I have NO idea how it'll react.
3. If the user aborts right after the file_did_download() function is called
but before the script actually terminates, things can go awry. I'm not
entirely sure how this would be handled.
--
- Daniel Grace <http://dewin.oldbattery.com/>
"Space may be the final frontier but its made in a Hollywood basement."
- Red Hot Chili Peppers - Californication
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]