getRealPath returning false (Image Intervention and Laravel 5.1)

情到浓时终转凉″ 提交于 2019-12-24 13:37:23

问题


I'm having a problem while using the getRealPath function.

$file = Input::file('archivo');
$img = Image::make($file->getRealPath());

I'm getting this exception:

NotReadableException in AbstractDecoder.php line 302. Image Not Readable.

I tried printing the value for $file->getRealPath() with dd() function and it prints false. Also I tried using dd(Input::hasFile( 'archivo' )) and that returned me true.

I can't seem to find an answer, I have tried almost everything I think.

So basically I want to know 2 things:

  1. Why is getRealPath returning me false and not the path?
  2. How am I supposed to send the route to Image::make(), I keep getting the annoying exception mentioned before even replacing getRealPath(), and sending instead the route as public_path()."routestring".

来源:https://stackoverflow.com/questions/33421090/getrealpath-returning-false-image-intervention-and-laravel-5-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!