How can I show you the files already stored on server using Dropzone.js

后端 未结 9 2106
长发绾君心
长发绾君心 2020-12-22 23:39

I Don\'t understand that... call its always undefined

Create the mock file:

var mockFile = { name: \"Filename\", size: 12345 };
         


        
9条回答
  •  佛祖请我去吃肉
    2020-12-23 00:08

    I was having hard time with this also. This one as a starting point would have helped even more:

    Dropzone.autoDiscover = false; // otherwise will be initialized twice
    var myDropzoneOptions = {
        maxFilesize: 5,
        addRemoveLinks: true,
        clickable: true
    };
    var myDropzone = new Dropzone('#myDropzoneElement', myDropzoneOptions);
    var mockFile = { name: "Existing file!", size: 12345 };
    myDropzone.options.addedfile.call(myDropzone, mockFile);
    myDropzone.options.thumbnail.call(myDropzone, mockFile, "http://url-to-thumb-goes-here");
    

提交回复
热议问题