Click a button: the page fetch()es the file (same-origin), wraps the bytes in a Blob, creates an object URL with URL.createObjectURL(blob), and clicks a hidden <a download>. Works for any MIME type.
fetch()
Blob
URL.createObjectURL(blob)
<a download>