<?php
$filename= './get/me/me_'.rand(1,100).'.zip';
header("Content-Length: " . filesize($filename));
header('Content-Type: application/zip');
header('Content-Disposition: attachment; filename=foo.zip');
readfile($filename);
?>
Run Code Online (Sandbox Code Playgroud)
嗨,我有这个简单的代码强制随机文件下载,我的问题是,如果我从同一浏览器调用脚本两次或更多次,第二次下载将不会开始,直到第一次下载完成或中断.因此,我每次只能下载一个文件.你有什么线索吗?