This is a migrated thread and some comments may be shown as answers.

Upload Validation not working

1 Answer 167 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Michael Hurse
Top achievements
Rank 1
Michael Hurse asked on 15 Nov 2016, 11:36 PM

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.

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 16 Nov 2016, 08:02 AM

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.
Tags
Upload
Asked by
Michael Hurse
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or