我有一个提供文件的 PHP 文件,但问题是无论使用什么浏览器,如果您单击 2 个指向 2 个单独文件的链接,则在第一个完成之前不会开始第二次下载!有任何想法吗?
下载代码
header('Content-Type: application/octet-stream');
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename="'.basename($filename).'"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($fullpath));
readfile($fullpath);
示例链接
- 链接1:download.php?downloadfile=1
- 链接2:download.php?downloadfile=2