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:
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 |
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:
multipleandwebkitdirectoryproperties (FileList)Behaviors:
<input type="file">FileList<input type="file" multiple>FileList<input type="file" webkitdirectory>FileListDrop EventFileSystemEntry[]/FileSystemHandle[]showOpenFilePicker()FileSystemFileHandle[]showDirectoryPicker()FileSystemDirectoryHandle