maxFiles:1 出错后 dropzone "You can not upload any more files"

dropzone "You can not upload any more files" after error with maxFiles:1

当发生错误且 maxFiles 设置为 1 时,dropzone 不会尝试上传另一个文件。

它不知何故认为它已经更新了文件。

$(this.element).dropzone({
      maxFiles: 1,
      createImageThumbnails: false,
      dictDefaultMessage: '',
      clickable: true,
      paramName: this.paramNameValue,
      url: this.urlValue,
      method: this.methodValue,
      init: function() {
        this.on("error", (fileObject, response) => {
          let msg
          try {
            msg = JSON.parse(response).join(', ')
          } catch (e) {
            msg = response;
          }
          console.log('error', msg)

        });
      }
    })

正如@DBS 提到的,我发现解决方案是手动删除文件。

这是它的样子:

$(this.element).dropzone({
      // ....
      init: this.on("error", (fileObject, response) => {
          this.removeAllFiles();
          // ...
        });
      }
    })