Is there any way to specify a suggested filename when using data: URI?

Use the download attribute:

<a download='FileName' href="https://stackoverflow.com/questions/283956/your_url">

The download attribute works on Chrome, Firefox, Edge, Opera, desktop Safari 10+, iOS Safari 13+, and not IE11.

Leave a Comment