demo · v132
Streaming write — chunked, with progress
The classic File System Access demo opens a file then dumps everything at once. The real win is streaming: createWritable() returns a WritableStream that accepts chunks and reports progress. Pick a size, save to disk, and watch the bytes go down.
checking createWritable…
0 / 0 bytes
the code
const handle = await showSaveFilePicker({ suggestedName: "blob.bin" });
const writable = await handle.createWritable();
for (let off = 0; off < total; off += chunkSize) {
await writable.write(makeChunk(chunkSize));
reportProgress(off);
}
await writable.close();
see also
- File System Access — feature index
- whole-file open/save editor
- Spec
- ChromeStatus entry