0

I've retrieved the URL of an image which has already been uploaded to a website. How can I programmatically add this image to my Dropzone component and see its preview instantly? I tried the following code but the image was not shown:

var mockFile = { name: "image.jpg", size: 12345 };
imgUrl = "http://example.com/image.jpg"
myDropzone.options.addedfile.call(myDropzone, mockFile, imgUrl);
B Faley
  • 17,120
  • 43
  • 133
  • 223

1 Answers1

1

You need to fire another event: thumbnail I can't check code but it should be something like this:

var mockFile = { name: "image.jpg", size: 12345 };
imgUrl = "http://example.com/image.jpg"
myDropzone.options.addedfile.call(myDropzone, mockFile);
myDropzone.options.thumbnail.call(myDropzone, mockFile, imgUrl);
waldek_h
  • 930
  • 9
  • 16