Simple-Ajax-Uploader
Simple-Ajax-Uploader copied to clipboard
Is there an example code for multiple files upload?
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: https://github.com/LPology/Simple-Ajax-Uploader/issues/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.
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); } });