jeudi 29 octobre 2015

getRealPath returning false (Image Intervention and Laravel 5.1)

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

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

I get NotReadableException in AbstractDecoder.php line 302. Image Not Readble.

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".

Thank you!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire