Open woniel123mx opened 9 years ago
Can you please explain where you edited the code?
@woniel123mx that doesn't seem to do anything on IE11...but it works in Chrome.
@woniel123mx also doesn't work in Firefox (latest). In fact neither the original solution (window.open) nor the Blob API solution above work in Firefox or IE11
I just use the following,rather than window.open
:
window.location.href = 'data:application/vnd.ms-'+defaults.type+';filename=otro.doc;'+base64data;
Appears to work well and doesn't pen up another window temporarily.
Hi good evening, i make a change when export to excel, is better make a Blob object :)
var ext = "doc"; if(defaults.type == "excel"){ ext = ".xls"; }
var blob = new Blob([excelFile], { type: 'text/plain' }); var a = document.createElement('a'); a.href = window.URL.createObjectURL(blob); a.download = defaults.tableName + ext; a.click();
//window.open('data:application/vnd.ms-'+defaults.type+';filename=otro.doc;' + base64data);