0
我正在使用下面的代码下载压缩文件。我确定该文件已存在并正在服务器上运行。提取后的结果是.cpgz文件。解压缩后下载zip文件导致.cpgz文件
return response()->download('/Applications/XAMPP/xamppfiles/htdocs/stoproject/source/storage/app/Copy of StoTherm Classic®.zip');
该代码正在工作,没有任何改变,停止。
我也尝试添加标题:
$headers = array(
'Content-Type' => 'application/zip',
);
return response()->download('/Applications/XAMPP/xamppfiles/htdocs/stoproject/source/storage/app/Copy of StoTherm Classic®.zip', basename('/Applications/XAMPP/xamppfiles/htdocs/stoproject/source/storage/app/Copy of StoTherm Classic®.zip'), $headers);
还与尝试:
'Content-Type' => 'application/octet-stream'