上传图片时,getRealPath()
总是返回false
:
$image_file = $request->file('image_file');
$image_file->getRealPath(); // ---> FALSE
这是结果dd($image_file);
:
此外,当我尝试将它与图像干预一起使用时:
$image_file = $request->file('image_file');
Image::make($image_file->getRealPath())->.....
我收到以下错误:
AbstractDecoder.php 第 323 行中的 NotReadableException:图像源不可读
显然是因为getRealPath()
返回false
...有人已经问过这个问题:getRealPath return false (Image Intervention and Laravel 5.1) ...但是没有解决方案。
你知道为什么会发生这种情况,我该如何解决这个问题?