susanBuck / e15-spring22

0 stars 0 forks source link

Unable to upload images to directory #71

Closed luannebe closed 2 years ago

luannebe commented 2 years ago

Hi, I am attempting to enable users to upload a photo via the form. This line in the Controller:

   $file->move(public_path('uploads'), $newfilename);

Triggers this error: [Unable to write in the "/var/www/e15/p3/public/uploads" directory.] Can anyone advise me what the proper ownership and permissions would be in order to make the directory safely writeable?

luannebe commented 2 years ago

Nevermind :) This worked:

sudo chmod -R 755 /var/www/e15/p3/public/uploads
chown www-data:www-data /var/www/e15/p3/public/uploads