Last active
April 23, 2021 13:10
-
-
Save cwhite92/b97f2679393074fb5090 to your computer and use it in GitHub Desktop.
Force download of BLOB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create URL to download the blob file | |
var url = URL.createObjectURL(blob); | |
// Create hidden anchor and click it to initiate the download | |
a = document.createElement('a'); | |
document.body.appendChild(a); | |
a.style = 'display: none'; | |
a.href = url; | |
a.download = conn.metadata.filename; | |
a.click(); | |
URL.revokeObjectURL(url); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment