上传图片时,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 返回 false(图像干预和 Laravel 5.1) https://stackoverflow.com/questions/33421090/getrealpath-returning-false-image-intervention-and-laravel-5-1...但没有解决办法。
您知道为什么会发生这种情况吗?我该如何解决这个问题?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)