|
Posted by Andy Jeffries on 02/15/07 09:26
On Wed, 14 Feb 2007 23:19:01 -0800, andrew.zahra wrote:
> Is there any way to track completion of a download with PHP? I would like
> to be able to check if a download completed successfully.
>
> My first thought is that I might need to use an applet?
>
> Any suggestions appreciated.
According to the PHP manual, scripts are aborted if the client
disconnects. Therefore assuming you're using a PHP script to download the
file if it gets to the line after readfile() (or some such code) then the
client connection is still active and therefore the download completed.
However, you can turn this functionality off so the script always
completes whether the client disconnects or not. So it may be best to use
connection_aborted() to see if the client is still connected.
You can read more about it here:
http://uk.php.net/manual/en/features.connection-handling.php
Cheers,
Andy
--
Andy Jeffries MBCS CITP ZCE CMDEV
Zend Certified Engineer
Certified MySQL Developer
gPHPEdit Lead Developer - http://www.gphpedit.org
Navigation:
[Reply to this message]
|