0
画像をアップロードすると、getRealPath()
は常にfalse
を返します。ここではgetRealPath()はfalse(Laravel 5.2&イメージの介入を)返し
$image_file = $request->file('image_file');
$image_file->getRealPath(); // ---> FALSE
はdd($image_file);
の結果である:
、私はイメージ介入でそれを使用しようとします:
$image_file = $request->file('image_file');
Image::make($image_file->getRealPath())->.....
私は次のエラーを取得しています
:getRealPath returning false (Image Intervention and Laravel 5.1) ...しかし、解決策はありません。
getRealPath()
戻り
false
理由は明らか
NotReadableException in AbstractDecoder.php line 323: Image source not readable
...誰かがすでにこの問題について尋ねました。
なぜこのようなことが起こっているのか、私はこれをどのように修正できますか?
はあなたの画像サイズが大きいですか?この回答を参考にしてくださいhttp://stackoverflow.com/questions/25929197/laravel-inputhasfileimage-returns-false-even-if-a-file-is-uploaded?rq=1 – Vikash
@Vikashいいえ、画像サイズは16kbだから、それは問題ではない。 – PeraMika
@PeraMika 'getRealPath()'メソッドの使用を避け、 'public_path()'メソッドを代わりに使用しようとしましたか?それはあなたの問題を解決するはずです。 – Mihailo