Skip to content
Advertisement

input type file multiple jQuery laravel

i´m traying to do a web application, that i can attach any files into email and insert name in Database.

i can see post in this site about this topic, but i can´t do it.

i have a input multiple that with this i can select any files:

JavaScript

with jQuery i´m traying get selected files:

JavaScript

this files or file i insert it into a FormData

JavaScript

After send formData to controller with Ajax:

JavaScript

When i do var_dump($filename) i can show only one file. If i do var_dump($uploadedFile)

web browser console show this:

JavaScript

only one file. If in jquery remove index [0] in web broser console show this:

JavaScript

i don´t know that i´m doing wrong… thanks for help and sorry for my english

after responses i trayed it:

JavaScript

with this result:

JavaScript

i´m traying select two img but only i can see one

UPDATE

php controller

JavaScript

SCRIPT JS that send files to controller:

JavaScript

Advertisement

Answer

My solution is:

JavaScript

and in controller:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement