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

Filter when selectiong multiple files

3 Answers 133 Views
Upload
This is a migrated thread and some comments may be shown as answers.
PDS
Top achievements
Rank 1
PDS asked on 09 Dec 2014, 09:27 AM
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.

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 09 Dec 2014, 01:27 PM
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!
 
0
PDS
Top achievements
Rank 1
answered on 10 Dec 2014, 10:25 AM
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.
0
Dimiter Madjarov
Telerik team
answered on 10 Dec 2014, 11:49 AM
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!
 
Tags
Upload
Asked by
PDS
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
PDS
Top achievements
Rank 1
Share this question
or