pekebyte / pekeUpload

jQuery html5 file uploader plugin
http://pekebyte.github.io/pekeUpload
Other
82 stars 73 forks source link

how to upload multiple files ? #31

Open agregator123 opened 7 years ago

agregator123 commented 7 years ago

With this script i can't upload multiple files. I added input like this: <input id="file" type="file" name="file" multiple/> but even if i choose multiple files, the preview shows me only one and in php i get only one file with $_FILES['file']

Maybe i don't understand the script or i miss something. Please, help me.

null-ref-0000 commented 7 years ago

I am having a similar issue. I see multiple files in preview, but only one file is sent in post data.

null-ref-0000 commented 7 years ago

Any suggestions for this issue?

evandrolacerda commented 6 years ago

I am having the same issue. Does anybody found any solution?

null-ref-0000 commented 6 years ago

I ended up using a different library as I was never able to resolve the issue.

evandrolacerda commented 6 years ago

@keanesf what library you used instead?

ronjordan commented 6 years ago

Hello, boys, I solved it this way!

First step - Replace HTML:

<input id="file" type="file" name="file" /> to <input id="file" type="file" name="file" multiple="multiple" />

Second step - Replace JS (pekeUpload.js v2.0):

Line 103: //pekeUpload.checkFile(pekeUpload.obj[0].files[0]); make a comment out

And new Line 103:

for (var i = 0; i < pekeUpload.obj[0].files.length; i++) {
    pekeUpload.checkFile(pekeUpload.obj[0].files[i]);
}

And that's it

It works with both: dragMode: false OR true also in the dragarea or button

Lots of fun Ron

podxboq commented 4 years ago

But v2.1.1 version, I replace the line 60

a.checkFile(a.obj[0].files[0])

by

for (var i = 0; i < a.obj[0].files.length; i++) { a.checkFile(a.obj[0].files[i]); }

Thanks @ronjordan