dropzone upload only one file

前端 未结 6 1305
时光说笑
时光说笑 2021-02-01 02:11

I am using dropzone.js for my drag-drop file upload solution. I want to upload only one file,if i upload second file the first one should be remove and second one should be uplo

6条回答
  •  庸人自扰
    2021-02-01 02:43

     Dropzone.prototype.defaultOptions.init = function () {
    
                     this.hiddenFileInput.removeAttribute('multiple');
                     this.on("maxfilesexceeded", function (file) {
                         this.removeAllFiles();
                         this.addFile(file);
                     });
                 };
    

    this is wokrk for me.

提交回复
热议问题