pedram pedram - 1 year ago 275
Javascript Question

How to create thumbnail for uploaded images on DropZone.js?

With below code i got all uploaded images with DropZone,but i now i have a simple problem, it already showing Orginal images as thumbnail but i need to show thumbnail with base64 same as dropzone made when want to upload new image.


init: function() {
var thisDropzone = this;
var pageid = $("#pageid").val();
$.getJSON('plugin/dropzone/get_item_images.php?id='+pageid, function(data) {

$.each(data, function(key,value){

var mockFile = { name:, size: value.size };, mockFile);, mockFile, "/admin/uploads/";
thisDropzone.emit("complete", mockFile);



so the problem is with this code i able to show uploaded images with dropzone but it show thumbnail with orginal images not real thubmnail that created with base64. dropzone made thumbnail with base64 when you want to upload new image, i want to show thumbnail like this.

Answer Source

You should use createThumbnailFromUrl , orginally posted here

myDropzone.emit("addedfile", mockFile);
myDropzone.createThumbnailFromUrl(mockFile, '/your-image.jpg');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download