【发布时间】:2019-10-13 20:29:16
【问题描述】:
我有应用 Laravel。
路径有一个存储:\storage\app\reports\
我试图通过 GET url 获取文件,例如:
http://localhost:8000/storage/app/reports/report_27-05-19_05.xlsx
但这对我不起作用。
我也尝试在后端返回文件:
$file = File::get(storage_path($path.$filename));
$type = File::mimeType($path.$filename);
$response = Response::make($file, 200);
$response->header("Content-Type", $type);
return $response;
【问题讨论】: