2

I am trying to show download file dialog using javascript in IE 11.But following code doesn't works for me

<a id="downloadLink" href="" target="_blank" onclick='download()'>Download</a>

on anchor tag click event download function is called

function download() {
          var link = document.getElementById('downloadLink');
          link.href = "data:image/png;base64,abcdefghijklmnop";
          link.download = '/systemcommon/BILL'+document.BankPaymentFile.sysDate.value+'.csv'; 
      }

It does not work as in IE 11 it doesn't suppport "download" attribute of anchor element.

Any other way to do this??

Nalini Wanjale
  • 1,717
  • 4
  • 19
  • 24
  • 1
    Seems like a duplicate of http://stackoverflow.com/questions/17968837/file-opens-instead-of-downloading-in-internet-explorer-in-a-href-link – ffffranklin Sep 15 '15 at 05:37
  • Duplicate of https://stackoverflow.com/questions/18394871/download-attribute-on-a-tag-not-working-in-ie as well – Prabhakar Kasi Jul 28 '17 at 21:59

0 Answers0