I send a png image file to controller in base64 via Ajax. I\'ve already test and sure that controller has received id but still can\'t save it to public folder.
$file = base64_decode($request['image']); $folderName = 'public/uploads/'; $safeName = str_random(10).'.'.'png'; $destinationPath = public_path() . $folderName; $success = file_put_contents(public_path().'/uploads/'.$safeName, $file); print $success;