In Dropzonejs i am creating delete button and then appending it to thumbnails, how can i link url which i am geeting from server directly to remove button by using
you can add delete link .. in Added file event ,you can get URL in Server response and set it in delete link.
myDropzone.on("addedfile", function (file) {
var _this = this;
/* Maybe display some more file information on your page */
var removeButton = Dropzone.createElement("");
removeButton.addEventListener("click", function (e) {
e.preventDefault();
e.stopPropagation();
var server_file = $(file.previewTemplate).children('.server_file').text();
// Do a post request and pass this path and use server-side language to delete the file
// $.post(server_file,{'X-CSRFToken': $cookies.csrftoken}, 'json');
$http({
method: 'POSt',
url: server_file,
headers: {
'X-CSRFToken': $cookies.csrftoken
}
});
_this.removeFile(file);
});
file.previewElement.appendChild(removeButton);
});