dimanche 17 juin 2018

How I save the file on server in Laravel PHP

I have send the file(Ex: A image) using Form data in JS and data received in Laravel backend side.

Array
(
    [filename] => imageedit_1_7173872236.png
    [filetype] => image/png
    [value] => iVBORw0KGgoAAAANSUhEUgAAAjgAAAJFCAYAAADQyY3pAACAAElEQVR42uz9e
)

$emailFile = $userData['avatar']['filename'] ?? '';

After that I have set the path to save the file but couldn't save it.

$destinationPath = public_path('voiceRecording');

$emailFile->move($destinationPath, $emailFile);

Please help me?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire