[英]can't write image data to path in laravel using the Intervention library
[英]Can't write image data to path in laravel 8 using the Intervention library
我正在使用 Laravel 8 我正面臨這個錯誤。
無法將圖像數據寫入路徑 (/home/u520518518/domains/dev.peacockindia.in/public_html/public/Backend/Image/Brand/2003012866_Brand-Image_Mobile_jpg)
這是我的代碼
if($request->logo){
$image = $request->file('logo');
$img = rand().'_'.'Brand-Image'.'_'.$request->title.'_'.$image->getClientOriginalExtension();
$loc = public_path('Backend/Image/Brand/'.$img);
Image::make($image)->save($loc);
$brand->logo = $img;
}
$image = $request->file('image');
$slug = Str::slug($request->name);
if (isset($image))
{
$currentDate = Carbon::now()->toDateString();
$imagename = $slug.'-'.$currentDate.'-'. uniqid() .'.'. $image->getClientOriginalExtension();
if (!file_exists('storage/uploads/employee-images'))
{
mkdir('storage/uploads/employee-images',0777,true);
}
$image->move('storage/uploads/employee-images',$imagename);
}else{
$imagename = "default.png";
}
我試過這個
$loc = 'Backend/Image/Brand/'.$img;
及其工作
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.