Created
February 11, 2021 11:24
-
-
Save milksense/0daca33246802265f08716ce2d6ba29f to your computer and use it in GitHub Desktop.
File downloading via Vanilla JavaScript
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
setTimeout(() => { | |
const a = document.createElement('a'); | |
a.download = 'file.txt'; | |
a.href = 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ=='; | |
a.click(); | |
}, 5e3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment