removeFileByUid
Removes a file by its ID by sending a standard remove
request to the handler.
The invoking of the
removeFileByUid
method does not trigger theremove
event.
Example
<input name="files" id="files" type="file" />
<button id="removeSelected" class="k-button">Remove all checked</button>
<script id="fileTemplate" type="text/x-kendo-template">
<span class='k-progress'></span>
<input id='#=files[0].uid#' type='checkbox' class='k-checkbox' />
<label for='#=files[0].uid#' class='k-checkbox-label'>Filename: #=name#</label>
</script>
<script>
$(document).ready(function() {
$("#files").kendoUpload({
template: $("#fileTemplate").html(),
async: {
autoUpload: false,
saveUrl: "http://my-app.localhost/save",
removeUrl: "http://my-app.localhost/remove"
}
});
$("#removeSelected").on('click', function(e){
e.preventDefault();
var upload = $("#files").data("kendoUpload");
upload.wrapper.find(".k-checkbox:checked").each(function() {
upload.removeFileByUid($(this).attr("id"));
});
});
});
</script>