尝试创建zip文件并在php-laravel中下载, 可以正常使用.txt文件 但是如果.png,zip存档 会损坏文件 即可。
`//Creating zip
$zip = new ZipArchive();
$zip->open($zip_file, ZipArchive::CREATE | ZipArchive::OVERWRITE);
$zip->addFile('/ramesh/work/31_receipt_cert.txt','31_receipt_cert.txt');
$zip->addFile('/ramesh/work/31_aadhaar.png','31_aadhaar.png');
$zip->close();
//Downloading zip
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($zip_file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($zip_file));
readfile($zip_file);
`
Winrar / Archive Manager无法打开并存在错误消息:
加载档案时发生错误