routes.php文件Laravel 5.5 - 沒有創建符號鏈接訪問存儲的圖像 - 拋出400錯誤
Route::get('img/{filename}', '[email protected]')->name('files.show');
我FilesController
public function show($filename)
{
if (!Storage::exists('img/' . $filename))
{
return 'error'; //file exist, this is never executes
}
$file = Storage::get('img/' . $filename); // this line breaks
dd($file);
return new Response($file, 200);
}
存儲::得到( 'IMG /' $文件名。 )在頁面上拋出錯誤400 ... 路徑是好的...
我不想公開鏈接,因爲我想圖像是私人的,只能通過控制器訪問...
檢查該文件的權限。 – aynber
我檢查了/ public/images文件夾中的圖像的權限... 我可以通過url訪問它們(例如:http:// localhost:8000/images/Dusan_RO8ujk2LVHuXH06F.png) – Dulo