我在使用该getRealPath功能时遇到问题。
$file = Input::file('archivo');
$img = Image::make($file->getRealPath());
我得到了这个例外:
NotReadableException in AbstractDecoder.php line 302. Image Not Readable.
$file->getRealPath()我尝试使用函数打印值dd()并打印false. 我也尝试使用dd(Input::hasFile( 'archivo' ))并返回了我true。
我似乎找不到答案,我已经尝试了几乎所有我想的东西。
所以基本上我想知道两件事:
- 为什么
getRealPath返回我是假的而不是路径? - 我应该如何将路由发送到,在替换并发送路由
Image::make()之前,我一直收到提到的烦人异常。getRealPath(),public_path()."routestring"