-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
I'm considering adding some utilities that would help unify behavior between all the separate import methods.
The idea is to make importing the same set of files/dirs result in an identical cid independent of which import method was used.
This is important as it will provide users with a solution to reliably import from most browser platforms.
I also want to make it easy to wrap the imported content in a directory on the condition of there being multiple pieces of content without a shared root directory.
The separate import methods:
- <input type="file" /> with or without
multipleandwebkitdirectoryproperties (FileList) - HTMLElement: drop event (FileSystemEntry or FileSystemHandle)
- window.showOpenFilePicker and window.showDirectoryPicker (FileSystemHandle)
Behaviors:
| Method / Element | Result Type | Items | Support Level | Mobile Friendly |
|---|---|---|---|---|
<input type="file"> |
FileList |
1 file | ✅ Standard | ✅ Yes |
<input type="file" multiple> |
FileList |
1 + files | ✅ Standard | ✅ Yes |
<input type="file" webkitdirectory> |
FileList |
0 + files (in dirs) | ☑️ Non-standard | ✅ Yes |
Drop Event |
FileSystemEntry[] / FileSystemHandle[] |
1 + files / dirs | ☑️ Partially standard | ❌ No |
showOpenFilePicker() |
FileSystemFileHandle[] |
1 + files | 🟡 Draft standard | ✅ Yes |
showDirectoryPicker() |
FileSystemDirectoryHandle |
1 dir | 🟡 Draft standard | ✅ Yes |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels