Laravel 4 Response download issue

ぐ巨炮叔叔 提交于 2020-01-06 18:00:53

问题


I am trying to force a download of a zip file that contains a few PDFS.

return Response::download($zipperPath, NULL, array('content-type' => 'application/zip'));

This will force the download.. however the files are corrupted. If I repair the zip it fixes the issue with the re-built zip. I am not sure if maybe I am missing something in the headers or if this is an issue with Laravel?

any help is appreciated, thanks.


回答1:


$response = Response::download($file, NULL, $headers);
ob_end_clean();
return $response;

https://github.com/laravel/framework/issues/2892



来源:https://stackoverflow.com/questions/22481546/laravel-4-response-download-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!