2013-03-05 131 views
1

上傳程序正常工作,但當我嘗試「刪除」任何上傳的文件時,該文件將被正確刪除,但HTML頁面中的行仍然像之前點擊! 如何在「刪除」按鈕單擊後刪除行?kendo上傳不刪除行當點擊「刪除」按鈕

此位置的代碼:

<script> 
    $(function() { 

    $("#upload").kendoUpload({ 
     async: { 
        saveUrl: "modules/save.php", 
        removeUrl: "modules/remove.php", 
        autoUpload: true, 
        multiple: true 
       } 
      }); 

    }); 

</script> 

這裏是remove.php:

<?php 
      $targetdir = "../files/"; 
      $targetPath = $targetdir.$_POST["fileNames"]; 
      unlink($targetPath); 
      echo ""; 
    ?> 

回答

0

檢查這個問題:KendoUI Uploader Remove

對於我來說,改變的返回類型做到了。

public ActionResult RemoveFile(string[] fileNames) 
{ 
    return Content(""); 
} 

public ActionResult RemoveFile(string[] fileNames) 
{ 
    return Json(""); 
} 

我離開了我SAVEFILE()函數return Content("");

0

<?php $targetdir = "../files/"; $targetPath = $targetdir.$_POST["fileNames"]; unlink($targetPath); echo "{}"; ?>

0
... 
async: { 
    saveUrl: "modules/save.php", 
    removeUrl: "modules/remove.php", 
    autoUpload: true, 
    multiple: true, 
    removeField: "fileNames[]" 
} 
+1

雖然這可能回答這個問題,這是一個良好想法提供一些解釋性文字,說明代碼如何解決問題。 – Makyen 2014-12-23 01:33:13

+0

您需要添加「removeField」選項和輸入的名稱(提交給刪除URL的表單字段的名稱) – 2015-01-13 00:17:18