SyntaxFix
Write A Post
Hire A Developer
Questions
You should check the download attribute and the window.URL method because the download attribute doesn't seem to like data URI. This example by Google is pretty much what you are trying to do.
download
window.URL