pekeUpload icon indicating copy to clipboard operation
pekeUpload copied to clipboard

how to upload multiple files ?

Open agregator123 opened this issue 7 years ago • 7 comments

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.

agregator123 avatar Apr 16 '17 11:04 agregator123

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

null-ref-0000 avatar May 23 '17 02:05 null-ref-0000

Any suggestions for this issue?

null-ref-0000 avatar Jun 09 '17 03:06 null-ref-0000

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

evandrolacerda avatar Jan 29 '18 02:01 evandrolacerda

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

null-ref-0000 avatar Jan 29 '18 02:01 null-ref-0000

@keanesf what library you used instead?

evandrolacerda avatar Jan 29 '18 20:01 evandrolacerda

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

ronjordan avatar Feb 25 '18 01:02 ronjordan

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

podxboq avatar May 29 '20 12:05 podxboq