Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add FileSystemEntry to DataTransferItemList ? #29

Open
mhofman opened this issue Mar 13, 2019 · 5 comments
Open

How to add FileSystemEntry to DataTransferItemList ? #29

mhofman opened this issue Mar 13, 2019 · 5 comments

Comments

@mhofman
Copy link

mhofman commented Mar 13, 2019

There doesn't seem to be a way to add FileSystemEntry objects to a DataTransferItemList, preventing creating drag (and clipboard) events containing directories.

This is currently preventing Chrome OS to implement drag and drop of directories since the Files app uses existing Web APIs. See https://crbug.com/937585

@inexorabletash
Copy link
Collaborator

Given the exploratory work going on around more modern file and datatransfer APIs, not going to rush to add something here.

@mhofman
Copy link
Author

mhofman commented Mar 13, 2019

Of course, just wanted to make sure the use case was captured.
Btw, how do these APIs relate to the directory-updload proposal? Has that been abandoned?

@inexorabletash
Copy link
Collaborator

So far as I know. IIRC, Microsoft and Mozilla were pushing on it, but ended up shipping an API compatible with Chrome's instead. (Which prompted me to write this to have the behavior documented.)

@Robinson-George
Copy link

Is the API compatible with Chrome capable of obtaining the files AND directories selected in the standard File Picker dialog?

@inexorabletash
Copy link
Collaborator

Is the API compatible with Chrome capable of obtaining the files AND directories selected in the standard File Picker dialog?

As noted over in #15 and https://wicg.github.io/entries-api/#issue-4cc238bb, in Chrome, webkitEntries is only populated as the result of a drag-and-drop operation, not when the element is clicked. This requires iterating over the File objects and reconstructing the directory tree using webkitRelativePath

Definitely not ideal. But also not exactly on topic for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants