Reputation: 2908
So, now that there is the Google folder upload API, I've been playing with it a little, but I'm stuck with one major flaw.
If I have an input like this:
<input type="file" id="files" name="files[]" multiple="" webkitdirectory="">
It only lets me upload folders, it doesn't allow me to upload single files too. And I can only upload one folder at that, even though multiple is selected. I don't mean subfolders though, it uploads those fine. I want to be able to select a couple different folders within the same or completely different directories to upload.
Is there something I'm doing wrong with this? I've also tried setting the accept attribute to all/* but that doesn't work.
Basically this feature is useless to me because it doesn't really allow for consistent functionality. It would let upload multiple files when deprecated, but only one folder when non-deprecated.
Upvotes: 2
Views: 2114
Reputation: 19890
I agree, the "select folders" feature is pretty much useless for the reasons you have stated. In Fine Uploader a cross-browser upload library I maintain, I decided to not support uploading folders via the select files dialog. Instead, I decided to make use of Chrome's Filesystem API support, which allows you to drop multiple folders and/or files simultaneously. I think allowing users to drop folders and/or files is much more intuitive than what the limited webkitdirectory
attribute allows.
Upvotes: 2