I recently hosted my first Laravel project. This therefore means that the public folder is on public_html
while the others are on one forder in the root.
I was uploading a file to the server and got the error Could not create img/photos directory
(paraphrase). I googled for quite some time and after that i gave 777 permission to img
and photos
and the error disappeared. The only thing is that now there is no error being caught but the file is just not being uploaded.
NOTE: In my form declaration i have set 'files'=>true
, i have properly modified my autoload and paths.php
paths.
// controller
// upload cover photo if any
$path = public_path().'/img/album-cover-photos';
if(Input::hasFile('photo'))
{
$ext = Input::file('photo')->getClientOriginalExtension();
$name = "Album-Cover-".$album->id.'-'.date('YmdHis').'.'.$ext;
Input::file('photo')->move($path,$name);
$album->cover_photo = $name;
$album->save();
}
What could the issue be?