1

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.

ataravati
  • 8,891
  • 9
  • 57
  • 89
Sai Avinash
  • 4,683
  • 17
  • 58
  • 96
  • Are you referencing the latest .js files? – ataravati Dec 06 '16 at 14:36
  • 2
    @ataravati.you got it right . Sorry for late response. I found that validations for kendo upload is a new feature but the js files which were are referring does not that. I am going to replace kendo js files with latest files and then check.Thanks – Sai Avinash Dec 08 '16 at 05:56

1 Answers1

1

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

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

oopsdazie
  • 716
  • 1
  • 7
  • 22