laravel下载远程文件报错
public function down(){
$attachment = Attachment::find(Input::get('id'));
$header = array(
'Content-Type' => Attachment::getMimetype($attachment->extension)
);
return Response::download($attachment->filepath,$attachment->filename,$header);
}
如果文件地址是本地服务器的没问题,换成远程地址就报错。
The file "http://www.xxx.com/test.xlsx" does not exist
PS:这远程文件是存在的哦。
2 个回复
糖古屋
赞同来自:
return Redirect::to('远程文件地址', 301);
安正超
赞同来自: