entries-api
entries-api copied to clipboard
How to add FileSystemEntry to DataTransferItemList ?
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
Given the exploratory work going on around more modern file and datatransfer APIs, not going to rush to add something here.
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?
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.)
Is the API compatible with Chrome capable of obtaining the files AND directories selected in the standard File Picker dialog?
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.