Created
July 25, 2019 11:17
-
-
Save andreoav/9358ea157aa31f39232855fdb7806a7f to your computer and use it in GitHub Desktop.
Download a blob using only JS in the client
This file contains 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
var text = 'Some data I want to export'; | |
var data = new Blob([text], {type: 'text/plain'}); | |
var url = window.URL.createObjectURL(data); | |
document.getElementById('download_link').href = url; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment