How to name a downloadable file in JavaScript using data url


All in all I did like this"data:application/octet-stream," + (JSON.stringify(content)), "fail");

Now the question arose how to name the file.


<a download='FileName' href='your_url'> , but not for all browsers ( ). your_url can be a Data URI like yours.

To automatically download this case, I think you just need to create an invisible link and make () on it.

Scroll to Top