Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在Dropzone JS中从服务器删除现有/上传的图像?_Javascript_Php_Referenceerror_Dropzone - Fatal编程技术网

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

Javascript 如何在Dropzone JS中从服务器删除现有/上传的图像?,javascript,php,referenceerror,dropzone,Javascript,Php,Referenceerror,Dropzone,我正在尝试从Dropzone JS中的服务器删除现有/上载的图像。每当我试图从服务器中删除现有映像时,都会遇到ReferenceError。请检查并指导我解决这个问题。这是我的密码 Product Edit.php removedfile: function(file) { existingFiles_gallery.forEach(function(mockFile, index) { }); var fileName =

我正在尝试从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;
   }
else{
$fileName = $targetPath.$_POST['name'];  
unlink($fileName); 
dropzone_upload.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;
   }
else{
$fileName = $targetPath.$_POST['name'];  
unlink($fileName); 
}

您的php文件不使用“请求:'删除”'