I upload files to my system and it works locally where I use windows and xampp, but when placing where I use the Ubuntu stack, my file does not load. I get a message saying that it cannot be written to the "system" directory, which is located in the shared folder. This is my code.
$destinationPath = public_path().'/system';
$extension = Request::file('add_students')->getClientOriginalExtension();
$fileName = rand(11111,99999).'.'.$extension;
$file=Request::file('add_students')->move($destinationPath, $fileName);
$path=$file->getRealPath();
after searching for solutions, I found out that I had to make my directory writable, so I ran the following command in putty
chmod 770 /var/www/html/public/system
but even after that I get an error message Unable to write in the "/var/www/html/public/system" directory.
I am using laravel 5 and my host is the digital ocean. Thanks
source
share