[ACCEPTED]-How to change thumbnail src value in Dropzone.js?-dropzone.js
Accepted answer
This worked for me:
$('.dropzone').dropzone({
init: function() {
this.on('success', function(file) {
var newname = generateServersideFilename(file.name); // this is my function
// changing src of preview element
file.previewElement.querySelector("img").src = newname;
}
}
});
dropzonejs have few examples of 1 using file.previewElement
This can be simply be
this.on("success", function(file) {
var mydropzone = this;
mydropzone.emit("thumbnail", file, "images/x.jpg");
});
here is the link from dropzone
0
this.on("addedfile", function (file) {
file.previewElement.querySelector("img").src = "music-box-outline.svg";
});
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.