Dropzone禁用上传

时间:2017-05-26 07:10:52

标签: javascript dropzone.js

如果我已经上传了1个文件,我想知道如何禁用上传。但如果我删除文件,ddropzone已启用上传。

这是我在js上的代码:

Dropzone.options.attachmenacc = {
            maxFiles: 1,
            accept: function(file, done) {

            },
            init: function() {
                this.on("maxfilesexceeded", function(file){
                    alert("No more files please!");
                });
            },
            addRemoveLinks: true,
            removedfile: function(file) {
                var name = file.name;        
                $.ajax({
                    type: 'POST',
                    url: host+'upload/bank/unfile',
                    data: "id="+name,
                    dataType: 'html'
                });
                var _ref;
                return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;   

                //console.log();
            },          
        }

现在在我的代码上,如果我添加更多上传文件,它会显示警告,并且这些文件(预期的第一个文件)不会上传,但它仍然显示该文件已上传。

0 个答案:

没有答案
相关问题