Closed Waize closed 8 months ago
What about it doesn't work?
If you use IE 11, the buttons doesn't trigger the download option. You click on the button and nothing happens.
Quite late for a reply but this worked well for me:
function saveAs(blob, filename) {
if (navigator.appVersion.toString().indexOf('.NET') > 0) { //check if browser is IE
if (window.navigator.msSaveOrOpenBlob) { //check if version supports msSaveOrOpenBlob
window.navigator.msSaveOrOpenBlob(blob, filename); //launch download prompt
}
} else {
var uri = URL.createObjectURL(blob);
var link = document.createElement('a');
if (typeof link.download === 'string') {
document.body.appendChild(link); //Firefox requires the link to be in the body
link.download = filename;
link.href = uri;
link.click();
document.body.removeChild(link); //remove the link when done
} else {
location.replace(uri);
}
}
}
IE11 is dead :)
Hey,
I like your work but it is not working with IE 11 :(
Can you please fix this?
Cheers, Waize