Intervention \\ Image \\ Exception \\ ImageNotWritableException using Laravel 4

感情迁移 提交于 2019-11-29 08:00:48

Make sure the public/img/products folder exists and it's writable and also try to use absolute path if necessary, like this:

$filename  = time() . '.' . $image->getClientOriginalExtension();
$path = public_path('img/products/' . $filename);
Image::make($image->getRealPath())->resize(468, 249)->save($path);

replace :

Image::make($image->getRealPath())->resize(468, 249)->save('/img/products/'.$filename);

with:

Image::make($image->getRealPath())->resize(468, 249)->save('public/img/products/'.$filename);

you must specify the public folder for the save method.

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