I am trying to image upload from android but i am getting error in json. In i am using the following code.
public function expense(Request $request)
{
$files = $request->file('image'); // file is name of input field
print_r($files);
if (isset($files)) {
echo "True";
foreach ($files as $file) {
echo "TEsting";
$destinationPath = 'uploads/expense';
$filename = $file->getClientOriginalName();
$savedFileName = date('Ymdhis')."_".$filename; // give a unique name to file to be saved
$file->move($destinationPath, $savedFileName);
}
} else {
echo "False";
}
}
I am getting this error(attaching the screenshot)
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire