如何在Dropzone JS中从服务器删除现有/上载的图像?

问题描述

我正在尝试从Dropzone JS中的服务器删除现有/上传的图像。每当我尝试从服务器中删除现有图像时,我都会遇到ReferenceError。请检查并指导我解决该问题。这是我的代码

Product-Edit.PHP

removedfile: function(file) {
             
     existingFiles_gallery.forEach(function(mockFile,index) {
          });
       var fileName = mockFile.name;
     $.ajax({
       type: 'POST',url: '/dropzone_upload.PHP',data: {name: fileName,request: 'delete'},sucess: function(data){
          console.log('success: ' + data);
       }
     });

     var _ref;
      return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
   }

dropzone_upload.PHP

else{
$fileName = $targetPath.$_POST['name'];  
unlink($fileName); 

}

Have a look the ERROR

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)