javascript - Cancel uploads in onStatusChange -
in our system allow uploads specific number can done in multiple upload sessions. when number of images in upload session exceed maximum number cancelling uploads in onstatuschange() instead of adjusting itemlimit:
thumbnailuploader = new qq.fineuploader({ element: document.getelementbyid('thumbnail-fine-uploader'), template: "qq-simple-thumbnails-template", request: { endpoint: 'uploader/uploader.php' }, thumbnails: { placeholders: { waitingpath: "uploader/waiting-generic.png", notavailablepath: "uploader/not_available-generic.png" } }, validation: { allowedextensions: ['jpeg', 'jpg', 'gif', 'png', 'bmp'], itemlimit: 6 }, callbacks: { onsubmit: function(id, filename){ // console.log("submitting..." + id); }, onstatuschange: function (id, oldstatus, newstatus) { // check see if file has been cancelled // equate uploads being 'completed'. if(parseint(galleryimages) + id + 1 > maxuploads && newstatus !== qq.status.cancelled){ this.cancel(id); return; } if (newstatus === qq.status.cancelled) { check_done(); return; } }, oncomplete: check_done, onupload: startupload } });
this seems work well, when switching on debugger get:
error: [fine uploader 5.0.3] 1 not valid file id upload!
in
now: function(id) { var name = options.getname(id); if (!controller.isvalid(id)) { throw new qq.error(id + " not valid file id upload!"); }
and bunch of:
"[fine uploader 5.0.3] caught exception in 'onstatuschange' callback - element undefined"
can fixed or these messages harmless?
thanks!
Comments
Post a Comment