How to filter file kendo-ui upload?

PeaceInMind picture PeaceInMind · Jun 18, 2014 · Viewed 9k times · Source

I'm using kendo-ui upload, I want to filter file (only allow choose .jpg, .png), but I don't know to implement in javascript, please help me!

1- .cshtml file

<input name="files" id="files" type="file" />

2- JavaScript

$(document).ready(function () {
    $("#files").kendoUpload({
        multiple: false,

        async: {
            saveUrl: "Home/Save"
        }
    });
});

Answer

PeaceInMind picture PeaceInMind · Jun 19, 2014

To filter file, implement as below:

<input name="files" id="files" type="file" accept=".jpg,.png"/>