发布网友 发布时间:2022-04-21 10:25
共2个回答
热心网友 时间:2023-11-09 20:21
$file=fopen('文件地址',"r");
$size=filesize('文件地址');
header("Content-Type: application/octet-stream");
header("Accept-Ranges: bytes");
header("Accept-Length: ".$size);
header("Content-Disposition: attachment; filename=文件名称");
echo fread($file, $size);
fclose($file);
热心网友 时间:2023-11-09 20:21
header("Content-Type: application/force-download");
header("Content-Transfer-Encoding: binary");
header('Content-Type: application/zip');
header('Content-Disposition: attachment; filename='.$sava_name);
readfile($sava_name);
试下