Hi,
I am trying to download base64 data using “window.location.href” in JavaScript. It works fine in Chrome but the same code is not working in IE11.
Could you please let me know the fix or a workaround for the same?
Here is the code:
Javascript:
function DownloadPdf() {
window.location.href = "data:application/pdf;base64,JVBERi0xLjMNJeLjz9MNCj........Pg1zdGFydHhyZWYNMTczDSUlRU9GDQ=="
}
function DownloadExcel() {
window.location.href = "data:application/vnd.ms-excel;base64,UEsDBBQABgAIAAAAIQB......BLBQYAAAAACgAKAIACAACzHAAAAAA="
}
HTML:
<input type="button" value="Download PDF" onclick="DownloadPdf()" />
<input type="button" value="Download Excel" onclick="DownloadExcel()" />