小编gio*_*gio的帖子

从同一浏览器和相同的PHP脚本下载php同步文件

<?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)

嗨,我有这个简单的代码强制随机文件下载,我的问题是,如果我从同一浏览器调用脚本两次或更多次,第二次下载将不会开始,直到第一次下载完成或中断.因此,我每次只能下载一个文件.你有什么线索吗?

php file download

2
推荐指数
1
解决办法
1607
查看次数

标签 统计

download ×1

file ×1

php ×1