- From: pqnet <notifications@github.com>
- Date: Thu, 29 May 2025 16:29:26 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/streams/issues/480/2920803691@github.com>
pqnet left a comment (whatwg/streams#480) To add my two cents, another very relevant use case is for end-to-end encryption of large files. The current workflow requires the files to be either sent decrypted by the server or to be downloaded in a blob, decrypted, then finally saved on the disk. Anyway, I think this may be an XY problem: the current "state of the art" to trigger a download programmatically involves going through setting an URL on a DOM `<a>` element, i.e.: ```javascript let a = document.createElement('a'); a.href = URL.createObjectURL(thing); a.download = 'my-file.dat'; a.click(); URL.revokeObjectUrl(a.href); ``` Maybe just having an API to trigger a download programmatically that does not involve creating DOM elements and setting an URL on them would help solve most use cases? For example something like: ```javascript await window.downloadStream(myStream, 'my-big-file.dat', 'application/octet-stream') ``` This would solve the problem of `createObjectURL` being leaky and the need to reset the stream for every time the URL should be downloaded. -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/issues/480#issuecomment-2920803691 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/streams/issues/480/2920803691@github.com>
Received on Thursday, 29 May 2025 23:29:30 UTC