Possible Duplicate:
how to know when download is finished
Hi,
I have a file which I want users to download only once. After it's done downloading, the file is no long开发者_如何学Cer available.
Outside of setting up a streaming system, is there any way I can set some sort of callback up to say the file is done downloading on the client's computer?
Thanks
You can use readfile() to send the file then do what you need to do.
header( 'content-type: file/type' );
readfile($filename);
file_is_done_downloading();
It's usually best to let people download for an hour or two just to make sure they get everything, since this doesn't support resuming downloads.
精彩评论