Validation not working

6 posts, 0 answers
  1. James
    James avatar
    40 posts
    Member since:
    Sep 2014

    Posted 09 Dec 2016 Link to this post

    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?

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2310 posts

    Posted 12 Dec 2016 Link to this post

    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
    Kendo UI is ready for Visual Studio 2017 RC! Learn more.
  3. James
    James avatar
    40 posts
    Member since:
    Sep 2014

    Posted 12 Dec 2016 in reply to Dimiter Madjarov Link to this post

    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

     

  4. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2310 posts

    Posted 12 Dec 2016 Link to this post

    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.

    Regards,
    Dimiter Madjarov
    Telerik by Progress
    Kendo UI is ready for Visual Studio 2017 RC! Learn more.
  5. James
    James avatar
    40 posts
    Member since:
    Sep 2014

    Posted 19 Dec 2016 in reply to Dimiter Madjarov Link to this post

    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
          };
  6. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2310 posts

    Posted 20 Dec 2016 Link to this post

    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
    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