ember-file-upload icon indicating copy to clipboard operation
ember-file-upload copied to clipboard

Investigate folder uploads

Open tim-evans opened this issue 8 years ago • 5 comments

This looks abandoned; it may be worthwhile to investigate briefly.

tim-evans avatar Apr 05 '16 04:04 tim-evans

There are two non-standard APIs that allow directory uploads. Both are controlled by properties on <input type="file">:

  • allowdirs
  • webkitdirectory

I'm tending toward not adding official support before one of them (or a third option) has been standardized.

jelhan avatar Mar 14 '20 13:03 jelhan

It looks like those attributes are for controlling whether directories can be submitted as input; not setting them does not prevent directories from being submitted. I came across this looking into a downstream bug (https://github.com/mnutt/davros/issues/140) where trying to drag & drop a directory just results in uploading an empty, regular file.

It seems like this could be implemented using the webkitrelativepath property on the File object, which is also non-standard, but it is very widely supported: https://caniuse.com/mdn-api_file_webkitrelativepath; I would argue it doesn't make sense to wait on the standards bodies for this.

zenhack avatar Mar 29 '22 22:03 zenhack

Thanks for your input @zenhack. Would you be interested in preparing a PR?

gilest avatar Mar 30 '22 01:03 gilest

I think I'm unlikely to find time to work on it myself at least in the short to medium term. And I'm probably the wrong person for the job -- I've never even used ember myself; my interest is as an end-user of said downstream app.

zenhack avatar Apr 02 '22 04:04 zenhack

this react plugin can upload a folder recursively : https://github.com/rpldy/react-uploady/tree/master/packages/ui/upload-drop-zone

oliverlj avatar May 22 '22 10:05 oliverlj