javascript - How to filter file kendo-ui upload? -



javascript - How to filter file kendo-ui upload? -

i'm using kendo-ui upload, want filter file (only allow take .jpg, .png), don't know 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" } }); });

you have utilize onselect event , restrict count want to.

http://docs.kendoui.com/api/web/upload#select

http://demos.kendoui.com/web/upload/events.html

function onselect(e) { if (e.files.length > 1) { alert("please select 1 file."); e.preventdefault(); } }

javascript jquery kendo-ui kendo-upload

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -