var excelFilePath = "aa.pdf";
var oReq = new XMLHttpRequest();
oReq.open("GET", excelFilePath, true);
oReq.responseType = "blob";
oReq.onload = function (oEvent) {
var content = oReq.response;
var elink = document.createElement('a');
elink.download = 'aa.pdf';
elink.style.display = 'none';
var blob = new Blob([content]);
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
document.body.removeChild(elink);
};
oReq.send();
js实现导出文件
最新推荐文章于 2024-08-19 11:16:23 发布