Upload Validation not working

2 posts, 0 answers
  1. Michael Hurse
    Michael Hurse avatar
    20 posts
    Member since:
    Jun 2008

    Posted 15 Nov 2016 Link to this post

    Hi,

    I have an upload control that the validation is not working on.  I am setting it to restrict to .jpg only and 2mb but the save action is called no matter what I upload to it.

    @(Html.Kendo().Upload()
        .Events(e => e.Success("onParent1UploadSuccess"))
        .Async(a => a
            .AutoUpload(true)
            .Save("SaveParent1", "HistoryForm", new { AdmissionPK = Model.AdmissionPK })
        )
        .ShowFileList(false)
        .Multiple(false)
        .Name("Parent1Upload")
        .Validation(v => v
            .AllowedExtensions(new string[] { ".jpg" })
            .MaxFileSize(2097152)
        )
        .Messages(m => m.Select("Select File..."))
    )

     

    How do I get the validation to actually work?

    Thanks.

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2210 posts

    Posted 16 Nov 2016 Link to this post

    Hello Michael,

    The provided configuration is correct and is working as expected on our end. If the problem is still persisting, could you send small isolated runnable example, in which it is reproducing (only the Upload widget View and the save action will be sufficient), so we could inspect it locally and provide assistance?

    I am looking forward to hearing from you.

    Regards,
    Dimiter Madjarov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top