This question is locked. New answers and comments are not allowed.
Hi,
I am using Telerik upload control in my MVC3 application. And I wanted to limit the upload files selection to 4. So I used below code.
@(Html.Telerik().Upload()
.Name("files")
.Multiple(true)
.Async(
async => async
.Save("Save", "MyController")
.AutoUpload(false)
.Remove("Remove", "MyController")
)
.ClientEvents(events => events
.OnSelect("onSelect")
)
)
function onSelect(e) {
var files = e.files;
alert(files.length);
if (files.length > 4) {
alert("4 files allowed.");
e.preventDefault();
}
}
But in the Javascript function I am getting the files.length always as 1.
Any reasons why?