function getFileDownLoad(fileData,fileName){ let blob = new Blob([fileData],{type:"application/pdf"}); // for ie 10+
if (window.navigator.msSaveBlob) { window.navigator.msSaveOrOpenBlob(blob,fileName); return;
} //google
let elink = document.createElement('a');
elink.href = URL.createObjectURL(blob);
elink.download = fileName; document.body.appendChild(elink);
elink.click()
URL.revokeObjectURL(elink.href); document.body.removeChild(elink);
}项目需要兼容ie,下载文件采用blob的形式兼容;文件可以下载但是ie没有文件后缀名,是我的写法有问题吗?
添加回答
举报
0/150
提交
取消