Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there an example code for multiple files upload? #217

Open
Julianoe opened this issue Jul 10, 2019 · 1 comment
Open

Is there an example code for multiple files upload? #217

Julianoe opened this issue Jul 10, 2019 · 1 comment

Comments

@Julianoe
Copy link

Julianoe commented Jul 10, 2019

Trying to implement a multi files upload but the progress bar is either deleted or not found or not updated properly. I wondered if someone had an example for multi upload configuration.

I read that it was discussed several years ago but could not find anything: #5

I'm looking to allow multiple files upload, either uploading at the same time or in a queued order it does not matter for me.

edit: just so my message is clearer: i edited the basic example and added "multiple: true" ans "multipleSelect: true". It works well, the files are uploaded, but the progressbar and result message only display for one file.

@Wesley-GONG
Copy link

here is working code, copy from my project
var btnfile = $("#btn_file"); var uploader = new ss.SimpleUpload({ button: btnfile, url: uploadUrl, name: 'uploadfile', allowedExtensions: ['jpg', 'jpeg', 'png', 'gif', 'mp4', 'pdf', 'doc', 'docx', 'zip'], responseType: 'json', maxSize: 2048, multiple: true, multipleSelect: true, autoSubmit: true, onSizeError: function () { this.removeCurrent(); alert("Size Error, 2Mb MAX"); }, onSubmit: function () { //this.removeCurrent(); }, onComplete: function (filename, response) { console.log('onComplete,' + filename); if (!response) { alert('upload failed'); return false; } alert('Upload OK'); //do something }, onError: function (filename, errorType, status, statusText, response, uploadBtn, fileSize) { alert(filename + '/' + errorType + '/' + status + '/' + statusText + '/' + response + '/' + uploadBtn + '/' + fileSize); } });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants