0
我真的生气后,花了四个小时没有结果。我想提供一个zip文件供下载。不通过链接,但与readfile(也许有另一种方式?)无论我已经尝试过,下载后的zip是空的。报价zip在php下载
$file = 'Passiv1.zip';
header('Content-Type: application/zip');
header('Content-Disposition: attachment; filename="'.$file.'"');
header('Content-Length: '.filesize($file));
readfile($file);
任何人都可以帮我吗?
检查是否存在Passiv1.zip像 – donald123
@ donald123还要检查你不需要文件的完整路径,即,如果它不在运行的php代码所在的文件夹中 – RiggsFolly