kendo-uikendo-asp.net-mvckendo-upload

ASP.Net MVC kendo File Upload validations not working


I have a simple Kendo MVC File Upload control. I want to restrict the file size and file type. Please find my code below:

<div>
    @(Html.Kendo().Upload()
        .Name("files123")
        .Async(a => a
            .Save("Save", "Upload")
            .Remove("Remove", "Upload")
            .SaveField("files")
        )
        .Validation(validation => validation.AllowedExtensions(new string[] { ".pdf" }))
    )
</div>

When I select an invalid format, it goes to the controller and the validation never gets fired.

I have spent considerable amount of time on this and could not find out any thing as nothing is happening.

Any inputs would be really helpful.


Solution

  • Kendo Upload validation is added after Kendo R3, 2016 release.

    Here is the link: http://docs.telerik.com/kendo-ui/controls/editors/upload/validation