0

I already upload my image in my image directory.Now after uploading when i show my image list then there have a button when any one click that button then image will be resize and save into another folder.

I am using Intervention Image to resize an save.

My code is:

Image::make(asset($get_data->front_image))
->resize(960, 960)->save('public/product_image_home_thumbs)

asset($get_data->front_image) means http://example.com/product_image/saree.jpg

But Its return a error

Can't write image data to path (public/product_image_home_thumbs)

My product_image_home_thumbs have 777 permission.

I cant understand. whats wrong

DanielBarbarian
  • 5,093
  • 12
  • 35
  • 44
Kinty1931
  • 11
  • 2
  • Your root directory is already in public. The save path should be '/product_image_home_thumbs/'. And another thing you did not properly terminate the single quote. – Rav Oct 18 '16 at 08:22

2 Answers2

0

Do you have it correctly ended? i see there is not apostrophe at the and and pracket is not closed. Maybe try to use full path. Check current directory where you have code in shell by command, sample output

pwd
/name_of_folder/../file.php
Matovidlo
  • 46
  • 6
0

You need to specify the filename too:

Image::make(asset($get_data->front_image))
    ->resize(960, 960)
    ->save('public/product_image_home_thumbs/[image_name].[image_extension]);

Replace [image_name] and [image_extension] with the name and extension you want the image to be encoded to.

Doom5
  • 857
  • 9
  • 18