Laravel 내 디렉토리에 쓰기.Laravel Wont 작성 디렉토리
오류가 발생합니다.
ErrorException
Unable to write in the "/var/www/laravel/laravel/public/img/retailer_images/12/" directory (View: /var/www/laravel/laravel/app/views/edit_retailer.blade.php)
파일 "IMG"
는 우분투에 의해 owend됩니다 : www가 데이터와 내가 뭔가를 간단 말이냐 확신 0777.의 권한을가집니다.
입력 코드는, (나는 다른 배포 서버에서 작동하기 때문에이 작품을 알고)입니다
if (file_exists ('/img/retailer_images/$retailer_id/banner.png') ) {
unlink('/img/product_images/$retailer_id/banner.png');
}
$file = Input::file('image');
$extension = Input::file('image')->getClientOriginalExtension();
if($extension=="jpg" || $extension=="jpeg")
{
$src = imagecreatefromjpeg($file);
}
else if($extension=="png")
{
$src = imagecreatefrompng($file);
}
else
{
$src = imagecreatefromgif($file);
}
list($width,$height) = getimagesize($file);
$tmp = imagecreatetruecolor("600","162");
$force_resize = imagecopyresampled($tmp,$src,0,0,0,0,"600","162", $width, $height);
$destinationPath = public_path().'/img/retailer_images/'.$retailer_id.'/';
$filename = "banner.png";
$uploadSuccess = $file->move($destinationPath, $filename);
$new_file_dest = $destinationPath.$filename;
DB::table('retailers')->where('id', $retailer_id)->update(array('retailer_img_url' => "http://sniip-kinetic-env-dqcu3vmfku.elasticbeanstalk.com/img/retailer_images/$retailer_id/banner.png"));
// TO DO add user friendly message here displayed with the image they just uploaded in a thumb size (300 X 300)
echo "<img src=/img/retailer_images/$retailer_id/banner.png height=162 width=600> </img><br />";
echo "file uploaded";
}
'File :: isWritable ('path')' – manix