I want a simple API to stream the data for a file download in JavaScript #158
aarongustafson
started this conversation in
Wants
Replies: 3 comments
-
Another option is to utilize |
Beta Was this translation helpful? Give feedback.
0 replies
-
Have you solved this? See https://wicg.github.io/file-system-access/#api-filesystemwritablefilestream |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It's currently possible to use a Blob URL to initiate the download of data held in memory. This is a useful feature to allow the to user to download data that is generated or processed by JavaScript. However, this only works for smaller amounts of data that can fit in RAM. When retrieving larger amounts of data (e.g., via a WebRTC data channel, or over a WebSocket), there's no way to allow the user to download the data without first buffering it all and creating a Blob.
I'd like a simple API that allows me to initiate a download with a suggested filename and expected size, triggering a download through the browser's standard download UI, and allowing me to feed in data as it becomes available. The simplest solution might be to support calling
createObjectURL
with aReadableStream
, though it doesn't look like that would provide a way to specify the expected total size.https://webwewant.fyi/wants/20/
Beta Was this translation helpful? Give feedback.
All reactions