New to Kendo UI for jQuery? Download free 30-day trial

Upload in Synchronous Mode File Type Validation


Product Progress® Kendo UI® Upload for jQuery
Operating System All
Browser All
Preferred Language JavaScript


How can I validate the file selected in the Upload by file type (extension), when synchronous mode is used?


When the Upload is configured to use synchronous mode the file type validation can be done with the Kendo UI Validator as demonstrated below.

    <form method="post" action="">
        <div class="demo-section k-content">
            <input name="files" id="files" type="file" aria-label="files" />
            <p style="padding-top: 1em; text-align: right">
                <button type="submit" class="k-button k-primary">Submit</button>
        $(document).ready(function() {
                validation: {
                    allowedExtensions: [".jpg"],

        var validatable = $("form").kendoValidator({
            rules: {
                upload: function(input) {
                    if (input[0].type == "file") {
                        return (input.closest(".k-upload").find(".k-file").length > 0 && input.closest(".k-upload").find(".k-file-invalid").length == 0);
                    return true;
    .k-upload-button .k-invalid-msg {
        display: none !important;
In this article