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

后端 未结 9 2094
长发绾君心
长发绾君心 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:22

    You can also do with the following code:

      
    

    EDIT

    Since update of Dropzone 4.0 init function can be called as:

    init: function () {
       var mockFile = { name: "myimage.jpg", size: 12345, type: 'image/jpeg' };       
       this.options.addedfile.call(this, mockFile);
       this.options.thumbnail.call(this, mockFile, "http://someserver.com/myimage.jpg");
       mockFile.previewElement.classList.add('dz-success');
       mockFile.previewElement.classList.add('dz-complete');
    }
    

提交回复
热议问题