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>
$(document).ready(function() {
$("#files").kendoUpload({
template: ({ files, name }) => "<span class='k-progress'></span>" +
`<input id='${files[0].uid}' type='checkbox' class='k-checkbox k-checkbox-md' />` +
`<label for='${files[0].uid}' class='k-checkbox-label'>Filename: ${name}</label>`,
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>