removeFile

Removes all files for which the callback function returns true by sending a standard remove request to the handler.

The invoking of the removeFile method does not trigger the remove event.

Example

<input name="files" id="files" type="file" />
<button id="removeFile" class="k-button">Remove non-image files</button>
<script>

  $(document).ready(function() {
    $("#files").kendoUpload({
      async: {
        autoUpload: false,
        saveUrl: "http://my-app.localhost/save",
        removeUrl: "http://my-app.localhost/remove"
      }
    });

    $("#removeFile").on('click', function(e){
      e.preventDefault();

      var upload = $("#files").data("kendoUpload");
      upload.removeFile(function(file){
        switch (file[0].extension) {
          case '.jpg':
          case '.img':
          case '.png':
          case '.gif':return false;
          default: return true;
        }
      });
    })
  });
</script>

Parameters

callback Function
In this article
Not finding the help you need?