在dropzone.js中上传setMaxFiles

setMaxFiles to upload in dropzone.js

本文关键字:setMaxFiles dropzone js      更新时间:2023-09-26

我想通过设置'maxfilesreached'属性来设置dropzone.js中达到的最大文件数,如下所示:

 maxfilesreached: function () {
      alert("Max Files reached")
  }

达到最大文件数时不触发

如何触发此事件?

注意:我在ASP中使用这个dropzone.js。净MVC

这是设置文件最大数目的简单代码

<form class="File" id="my-file"></form>

和JS:

File.options.my-file = {
maxFiles: 1,
accept: function(file, done) {
console.log("uploaded");
done();
 },
init: function() {
this.on("maxfilesexceeded", function(file){
    alert("No more files please!");
});
 }
};