问题
I have integrated dropzone library with laravel .Dropzone set following configuration
autoProcessQueue: true,
uploadMultiple: true,
parallelUploads: 10,
maxFiles: 10,
paramName: "photos",
addRemoveLinks: true,
while sending images i will pass id also using this.on("sendingmultiple", function(data, xhr, formData)
But I have following two problems
1.when i upload single or multiple images,image uploaded successfully but i need to set server side generated image name and id to dropzone image,so that on delete i can pass iamgename and id to delete image.I have tried many methods but it doesn't work me
this.on("successmultiple", function(files, response) {
// _this.removeAllFiles();
var dzClosure = this;
$.each(response, function (index, data) {
var mockFile = { name: data.image_name, size: 12345 ,photoId:data.id};
dzClosure.files.push( mockFile );
dzClosure.options.addedfile.call(dzClosure, mockFile);
dzClosure.options.thumbnail.call(dzClosure, mockFile,url+data.image_path+data.image_name);
})
i have tried on success multiple to remove all files and set images using server side .Problem here is remove files call server side delete.
2.Also i faced same problem on server side image validation .unable to delete error image automatically on error
来源:https://stackoverflow.com/questions/59332026/dropzone-delete-not-working-on-server-side-success