Click here to Skip to main content
15,915,975 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
data:application/vnd.ms-excel;filename=exportData.xls;base64,myfilenameis   PGh0bWwgeG1sbnM6bz0ndXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTpvZmZpY2U6b2ZmaWNlJyB4bWxuczp4PSd1cm46c2NoZW1hcy1taWNyb3NvZnQtY29tOm9mZmljZTpleGNlbCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnL1RSL1JFQy1odG1sNDAnPjxoZWFkPjwhLS1baWYgZ3RlIG1zbyA5XT48eG1sPjx4OkV4Y2VsV29ya2Jvb2s

What I have tried:

When i downloading from above link file name showing me each time different like fsdffsd .xls or fdsfd.xls or download.xls(in crome only)

how to i define file name? 
Posted
Updated 11-Oct-19 7:01am

1 solution

As suggested in this StackOverflow thread[^], you need to use the download attribute.

<a>: The Anchor element - HTML: Hypertext Markup Language | MDN[^]
Can I use... Support tables for HTML5, CSS3, etc[^]

It doesn't work in Internet Explorer, but as we all know, even Microsoft don't consider IE to be a browser[^] these days.

If you really need to support IE, there are other options - for example:
eligrey/FileSaver.js: An HTML5 saveAs() FileSaver implementation[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900