Skip to content

Instantly share code, notes, and snippets.

@cwhite92
Last active April 23, 2021 13:10
Show Gist options
  • Save cwhite92/b97f2679393074fb5090 to your computer and use it in GitHub Desktop.
Save cwhite92/b97f2679393074fb5090 to your computer and use it in GitHub Desktop.
Force download of BLOB
// 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