开发者

I want to know when a file is done downloading [duplicate]

开发者 https://www.devze.com 2022-12-22 02:20 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: how to know when download is finished
This question already has answers here: Closed 12 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消