entries-api icon indicating copy to clipboard operation
entries-api copied to clipboard

How to add FileSystemEntry to DataTransferItemList ?

Open mhofman opened this issue 5 years ago • 5 comments

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

mhofman avatar Mar 13 '19 00:03 mhofman

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

inexorabletash avatar Mar 13 '19 17:03 inexorabletash

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?

mhofman avatar Mar 13 '19 19:03 mhofman

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.)

inexorabletash avatar Mar 13 '19 19:03 inexorabletash

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

Robinson-George avatar Oct 15 '19 02:10 Robinson-George

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.

inexorabletash avatar Oct 15 '19 20:10 inexorabletash