Dropzone FormData 在 `sendingmultiple` 事件中不可用?

Dropzone FormData not available in `sendingmultiple` event?

我正在使用这个后续事件 http://www.dropzonejs.com/#event-successmultiple

尝试遍历 FileData 中的所有文件并向它们附加一些额外的属性。使用 sendingmultiple 时 FileData 为空。使用常规发送事件时有效。

sendingmultiple: (files, xhr, formData) => {
        for(let o of formData.entries()) {
          console.log('testing 123', o);
          //FormData is empty when using `sendingmultiple` event.
        }
      }

files 数组显示 25 个文件,而 formData 为空..

在您的函数中使用 formData.append()

我还没有用 successMultiple 测试过这个,下面是我的用例:

function init(dropzone) {
  dropzone.on('sending', (event, xhr, formData) => {
    formData.append('mimeType', event.type);
    formData.append('filename', event.name);
  });
}

const eventHandlers = {
  init,
  maxfilesexceeded: function(file) { // eslint-disable-line
    this.removeAllFiles();
    this.addFile(file);
  },
};