Dropzone delete not working on server side success

心不动则不痛 提交于 2020-01-24 00:24:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!