Filter when selectiong multiple files

4 posts, 0 answers
  1. PDS
    PDS avatar
    6 posts
    Member since:
    Mar 2011

    Posted 09 Dec 2014 Link to this post

    Hi.

    I have an upload control that allows selecting directories. I'd like to limit folder the recursion. My idea is to filter the files in the select event of Upload by doing something like:
       e.files = ko.utils.arrayFilter(e.files, function(item) { return self._count(item.rawFile.webkitRelativePath, '/') === 1; }

    Obviously this does not work and all the elements are added to the uploader. Is there a way to filter individual files when selecting them?

    Thanks.
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 09 Dec 2014 Link to this post

    Hello,


    Both of the listed requirements - uploading folders and filtering the selected files in the select event are not supported at the moment in the Kendo UI Upload widget.

    Regards,
    Dimiter Madjarov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. PDS
    PDS avatar
    6 posts
    Member since:
    Mar 2011

    Posted 10 Dec 2014 in reply to Dimiter Madjarov Link to this post

    Hi Dimiter.

    Uploading folders works by just adding webkitdirectory to the input tag.
    But the selection event passes all files selected (in multiselection or the folder) so I cannot exclude individual files by preventing the event. What I had to do is to let the control to add all files and then delete them my self at the end of the selected event.
    Very inefficient but it seems to be the of making it work.
  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 10 Dec 2014 Link to this post

    Hello,


    Thanks for the update. Regarding the feature, it is not supported, because it won't work in all Kendo UI supported browsers.

    Regards,
    Dimiter Madjarov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready