我有一个处理文件下载请求的 php 页面。我需要能够检测文件何时成功下载。如何才能做到这一点?也许有一些方法可以检测到这个客户端,然后将确认发送到服务器。
谢谢。
编辑:通过句柄,我的意思是页面正在做这样的事情:
$file = '/var/www/html/file-to-download.xyz';
header('Content-Type: application/octet-stream');
header('Content-Length: ' . filesize($file));
header('Content-Disposition: attachment; filename=' . basename($file));
readfile($file);