samedi 1 février 2020

Call to a member function file() on array Error when try to send multiple file()

Laravel says I sent file :

Files

product [ { "mainpic": { "pathname": "/tmp/phpxJefSH", "size": 209982, "mimeType": "image/jpeg" } } ]

Now I tried to get image and upload it with this code in Controller :

$pic = $this->uploadImages($req->file('product')[$key]->file('mainpic'));

Laravel logged this error :

Call to a member function file() on array

and It's from that line of code.

How can I get an image from this uploaded version in the form?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3aXTIuF
via IFTTT

Aucun commentaire:

Enregistrer un commentaire