4 ms·
But webkitdirectory="true" could already do that, no?
by yread 4mo ago
But webkitdirectory="true" could already do that, no?
- deleted 4mo ago[deleted]
- justusthane 4mo agoNo, they're very different. Using webkitdirectory="true" on an <input> element just allows you to select a directory to e.g. upload it to the server. It's a one-time operation. This API returns a handle to the selected directory, giving the webpage ongoing read/write access to the directory. You couldn't use the former to e.g. create a local-first notes app that stores its files on disk.
- simonw 4mo agoThat's read-only. It's very cool though, and worth learning about for anyone who's unfamiliar. I have a demo page showing what it can do here: https://tools.simonwillison.net/webkitdirectory https://tools.simonwillison.net/webkitdirectory