Created
August 16, 2017 22:54
-
-
Save lucas-pelton/1dd3e2f22dfb3026b730d9ce3e2ef88f to your computer and use it in GitHub Desktop.
Auto Download Content from DataURL
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
// AUTO DOWNLOAD THE IMAGES --> Can be modified to use any DataURL, I suppose | |
var a = document.createElement('a'); | |
a.href = canvas.toDataURL("image/jpeg"); | |
a.download = 'sample.jpg'; | |
document.body.appendChild(a); | |
a.click(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment