我从服务器以zip文件发送zip存档,但无法通过浏览器接收。尽管可以在服务器上正确创建zip存档。
$zip->addFile('../image/' . $prod[0]['image'], $path_parts['basename']);
$zip->close();
header('Content-type: application/zip');
header('Content-Disposition: attachment;
filename="'.basename($zip_filename).'"');
header("Content-length: " . filesize($zip_filename));
header("Pragma: no-cache");
header("Expires: 0");
ob_clean();
flush();