Make sure the img/* folders are writable chmod -R 755 public/img
Jun 8, 2015
9
Level 1
error message when saving image
hey guys am trying to upload files and saving image to my disk, but i get this error message any help error code is
NotWritableException in Image.php line 138: Can't write image data to path (public/img/products/2015-06-08-16:37:54-product2-hover.jpg)
and my code is.
$product = new Item;
$product->titlename = $item->itemname;
$product->designer = $item->designer;
$product->brand = $item->brand;
$product->available = $item->available;
$product->size = $item->size;
$product->description = $item->description;
//check if images are upladed
if($item->hasFile('frontimage')){
$frontImage = $item->file('frontimage');
$filename = date('Y-m-d-H:i:s')."-".$frontImage->getClientOriginalName();
$img = Image::make($frontImage->getRealPath())->resize(468, 249)->save('public/img/products/'.$filename);
$product->imageFront = 'img/products/'.$filename;
$product->save();
Please or to participate in this conversation.