The purpose of this demo app is to show the different ways in which files can be handled on the web.
Read my blog post for more information about this.
The app supports the following features:
<input type=file>
input.File System Access
API to open a file (or re-open a previously opened file).<a download>
element.Web Share
API.File System Access
API to save back to the file, or save as a new file.npm install
npm run build
public
directory.🖥 = limited to desktop platforms
📦 = requires installation
🚧 = experimentally supported
✅/⛔️ without label = applies to all platforms (iOS only counts for Safari)
Chrome | Edge | Safari | Firefox | |
---|---|---|---|---|
<input type=file> |
✅ | ✅ | ✅ | ✅ |
🖥 Drag and drop file | ✅ | ✅ | ✅ | ✅ |
Paste file | ✅ Windows ✅ macOS ⛔️ Android* |
✅ Windows ✅ macOS ⛔️ Android* |
✅ | ⛔️ (bug) |
📦 Web Share Target | ⛔️ Windows† ⛔️ macOS ✅ Android† |
✅ Windows† ⛔️ macOS ⛔️ Android† |
⛔️ | ⛔️ |
📦 File Handling (?) | 🚧 Windows‡ ⛔️ macOS ⛔️ Android |
❓ Windows‡ ⛔️ macOS ⛔️ Android |
⛔️ | ⛔️ |
File System Access | ✅ Windows ✅ macOS ⛔️ Android |
✅ Windows ✅ macOS ⛔️ Android |
❓§ | ⛔️ |
<a download> |
✅ | ✅ | ✅ | ✅ |
Share file ( navigator.share ) |
✅ Windows ⛔️ macOS (bug) ✅ Android |
✅ | ✅ | ⛔️ (bug) |
*On Android, it is not possible to paste files to the web because the clipboard can’t contain files.
†On Windows, only PWAs installed through Edge appear in the system’s share dialog. On Android, only PWAs installed through Chrome appear in the system’s share dialog.
‡File Handling is experimentally supported in Edge on Windows, but when choosing to open a text file in the demo app (“Open with…”), the app opens in its default state without the file’s contents; see #5.
§File System Access is experimentally supported in Safari, but it doesn’t (yet) work in the demo app.