dropzone.js - How to run Dropzone processQueue() when not initiating programmatically? -
im trying initiate dropzone adding class form :
<form class="dropzone ng-pristine ng-valid dz-clickable" id="photodropzonediv" action="/panel/vehicles/3/photos" accept-charset="utf-8" method="post">
now dropzone works. next set dropzone not auto process queue :
dropzone.options.photodropzone = { paramname: "file", // name used transfer file maxfilesize: 5, // mb autoprocessqueue: false, paralleluploads: 500, acceptedfiles: '.jpg,.jpeg,.jpeg,.jpg,.png,.png', addremovelinks: true, init: function(file, done) { this.on("queuecomplete", function(file) { this.removeallfiles(); }); } };
now when call processqueue :
photodropzone.processqueue();
it says uncaught typeerror: photodropzone.processqueue not function
. how can fix this?
dropzone.options.addfiles = { maxfilesize : 4, paralleluploads : 10, uploadmultiple: true, autoprocessqueue : false, addremovelinks : true, init: function() { var submitbutton = document.queryselector("#act-on-upload") mydropzone = this; submitbutton.addeventlistener("click", function() { mydropzone.processqueue(); }); mydropzone.on("addedfile", function(file) { if (!file.type.match(/image.*/)) { if(file.type.match(/application.zip/)){ mydropzone.emit("thumbnail", file, "path/to/img"); } else { mydropzone.emit("thumbnail", file, "path/to/img"); } } }); mydropzone.on("complete", function(file) { mydropzone.removefile(file); }); }, };
Comments
Post a Comment