2

我在我的页面上使用 dropzone 来上传图像,但由于某种原因它没有选择“autoProcessQueue”选项

我在我的页面中粘贴了这个确切的代码,只要我从本教程中选择图像,它仍然会上传:https ://github.com/enyo/dropzone/wiki/Upload-all-files-with-a-button

Dropzone.options.myDropzone = {

  // Prevents Dropzone from uploading dropped files immediately
  autoProcessQueue: false,

  init: function() {
    var submitButton = document.querySelector("#submit-all")
        myDropzone = this; // closure

    submitButton.addEventListener("click", function() {
      myDropzone.processQueue(); // Tell Dropzone to process all queued files.
    });

    // You might want to show the submit button only when 
    // files are dropped here:
    this.on("addedfile", function() {
      // Show submit button here and/or inform user to click it.
    });

  }
};
4

2 回答 2

0

我遇到了同样的问题,结果证明我使用的是过时版本的 Dropzone。该autoProcessQueue功能仅在 v3.6.0 中添加,因此请确保至少使用该功能。

于 2013-11-22T17:55:36.980 回答
-1

您必须查看您制作的代码 autoProcessQueue: false,

让它成为现实

autoProcessQueue: true, 并且在你的dropzone.js中检查这个参数的值 并在那里改变它,它肯定会工作..

于 2013-10-15T09:58:57.537 回答