I have an upload object I am trying to use in an Angular app. I have used the samples on the demo page and can not seem to get these items to work. Below are both my HTML and the validation section from my javascript.
<input name="files" ng-model="vm.file" kendo-upload k-options="vm.uploadOpts" type="file" /> vm.uploadOpts = { async: { saveUrl: "{0}FileManagement/Save".format(GMT.Config.baseApiUrl), autoUpload: true }, validation: { maxFileSize: 304, allowedExtensions: ["upd", "txt", "xls", "doc", "docx", "xml", "xlsx", "csv", "xlsm"] }, error: this.onError, success: this.onSuccess };
Why is it not utilizing this information?
5 Answers, 1 is accepted
Hello James,
I am not sure what is causing the validation to not work on your end. Here is a small example that I used for testing. Could check it out and let me know if I am missing something?
Regards,Dimiter Madjarov
Telerik by Progress
Thanks we are using a drag and drop upload with the dropzone class. Now that I see what you sent, if I select a file it seems to work but if I drag and drop a file it does not. Also, where can i find the error on failure in the error call back
Hello James,
I have tested the approach with a dropzone and a custom dropzone, but was unable to reproduce the issue on our end. Please send us an example (or modify the one that I sent in the previous post) in which we could observe the problem.
I am looking forward to hearing from you.
Dimiter Madjarov
Telerik by Progress
Here is the entire form for the upload with the do
<form method="post" enctype="multipart/form-data" class="dropzone"> <div class="dz-message"> <input name="files" ng-model="vm.file" kendo-upload k-options="vm.uploadOpts" type="file" /> <h5><span class="fa fa-cloud-upload"></span><br>{{'fileManager.upload.cta.MESSAGE' | translate}}</h5> </div></form>
this.uploadOpts = { async: { saveUrl: "{0}FileManagement/Save".format(GMT.Config.baseApiUrl), autoUpload: true }, validation: { maxFileSize: 304, allowedExtensions: ["upd", "txt", "xls", "doc", "docx", "xml", "xlsx", "csv", "xlsm"] }, error: this.onError, success: this.onSuccess };Hello James,
Here a similar implementation, which is working as expected on our end. I am unable to observe the false behavior in this example. Could you modify it in order to reproduce the case?
Regards,Dimiter Madjarov
Telerik by Progress