return response()->file($url); 或者 return response()->download($url);
我都試過。。但只會輸出文件內(nèi)容,并不會將文件下載下來,
要傳遞下載后保存的文件名,比如 a.txt
return response()->download($url, 'a.txt');
大佬,download確實是,file()這個又是做什么用的
http://www.wtbis.cn/doc/webman/response.html#%E4%B8%8B%E8%BD%BD%E6%96%87%E4%BB%B6
好哦
前端應(yīng)該怎么請求呀?