I am trying to download a CSV file to the browser. I am unable to get it to properly download the file in IE11. Instead it opens a new tab and write the CSV contents to the tab.
I am using just the following javascript:
window.open(sUrl, '_target');
In the IE Developer tools, I can see the Response Header shows:
Content-Type: text/csv; charset=UTF-8
I would like it to prompt the user to save the file. I've changed the browser settings to always download, yet it still doesn't do it.
I would like to fix this from a change to the Javascript, if possible. How can I do that?