我观看了有关dropzone的视频教程,并尝试使用它,但是它在我的程序中不起作用。 这是我的html
<form id="myAwesomeDropzone" method="POST" action="index.php" class="dropzone dz-clickable" >
<div class="dz-default dz-message" data-dz-message="">
<span>Drop files here to upload</span>
</div>
</form>
这是我的js
Dropzone.options.myAwesomeDropzone = {
addRemoveLinks: true,
autoProcessQueue: false,
acceptedFiles: ".png, .jpg, .jpeg, .docx, .pdf",
init: function(){
var submit = document.querySelectory("#submitBtn");
myDropZone = this;
submit.addEventListener("click", function(){
myDropZone.processQueue();
});
this.on("complete", function(){
if(this.getQueuedFiles().length == 0 && this.getUploadingFiles().length == 0){
var _this = this;
_this.removeAllFiles();
}
});
}
};