[英]Intervention\Image\Exception\NotWritableException: Can't write image data to path
[英]Can't write image data to path - Intervention Image
我正在尝试使用laravel项目中的Intervention包来调整图像大小。 我可以使用Storage Facade来存储图像,但是当我将其与Image类一起存储时,它会抛出以下错误。
无法将图像数据写入路径(/var/www/commerce/storage/featureds/2-1537128615.jpg)
if ($request->has("featured_img")) {
$file_path = $request->get("featured_img");
$exp = explode("/",$file_path);
$filename = $exp[1];
$featured_path = "featureds/".$filename;
\Storage::copy($request->get("featured_img"), $featured_path);
\Image::make(\Storage::get($featured_path))->fit(400, 300)->save(storage_path($featured_path));
$product->media()->where("type", "featured")->update(["path" => $featured_path]);
}
我怎样才能解决这个问题 ? 谢谢你的帮助
存储器中是否有特色目录?
如果否,则使用mkdir来创建目录,因为Intervention不会自动创建目录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.