I am developing a laravel web app. I created a section for managing employees. in this area I uploading a profile picture for employee.
when Uploading image there is no error and its working fine in add new employee area.
But when editing an employee the image upload area is not taking changed image ( new image)
here is my code..
$photopaath = Employee::find(Input::get('employeeId'));
$fullpath = $photopaath->emp_photo;
if (Input::hasFile('picuplodr'))
{
File::delete(app_path().$fullpath);
//$name = Input::file('picuplodr')->getClientOriginalName();
$fileName = "photo".snake_case(Input::get('efname')).snake_case(Input::get('elname')).snake_case(Input::get('eemailaddrs'));
Input::file('picuplodr')->move($destinationPath, $fileName);
$path = Input::file('picuplodr')->getRealPath();
$phototodb = '/uploads/'.$fileName;
return "ssssssssssss";
}
else{
$phototodb = $fullpath;
return "ffffffff";
}
its taking as else contition and returning as ffffffff.
Why this happening like this ?
I changed the image and not going to the if (Input::hasFile('picuplodr')) contition..
I changed the permission to 777 of my project directory also but not getting solution for this.
How can i solve this...?