Change validation of kendo upload control dynamically

1.1k Views Asked by At

Could you please help me how to change allowedExtensions valiation of kendo file upload control dynamically runtime using Jquery?

e.g. Suppose user select to upload the media file, then allowedExtensions should be change to ".mp4".

 $("#filesFromLocal").kendoUpload({
                success: PWonSuccess,
                upload: PWonUpload,
                error: PWonError,
                multiple: false,
                cache: false,
                contentType: false,
                processData: false,
                validation: {
                    allowedExtensions: [".pdf"],
                    maxFileSize: maxFileSize
                },
                async: {
                    saveUrl: saveURL,
                    chunkSize: chunkSize,
                    autoUpload: false
                },
                remove: function (e) {
                    var fileInfo = $("#filesFromLocal").data("kendoUpload").getFiles();
                    if (fileInfo.length == 2) {
                        LocalDeletedFile = false;
                    }
                    else {
                        LocalDeletedFile = true;
                    }
                },
                select: onimportselect
            });
0

There are 0 best solutions below