当前位置:网站首页>Pdf file download (the download name is the same as the file name)
Pdf file download (the download name is the same as the file name)
2022-06-25 19:47:00 【We are all lemonade】
window.JSZip = require("jszip");
import axios from "axios";
axios({
method: "get",
responseType: "blob", // Because it's a stream file , So specify blob type
url: item.fileUrl, // Your own server , One of the word Download File Interface
}).then( res => {
if(res.data.size > 0){
const content = res;
const blob = new Blob([content]);
const fileName = item.name +'.pdf' || ' unnamed .pdf';
if ('download' in document.createElement('a')) { // Not IE download
const elink = document.createElement('a');
elink.download = fileName;
elink.style.display = 'none';
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href); // Release URL object
document.body.removeChild(elink);
} else { // IE10+ download
navigator.msSaveBlob(blob, fileName);
}
}
});
边栏推荐
- Database data type design (the most detailed in the whole network)
- Solve the problem that sublime Text3 package control cannot install plug-ins
- RPM package installation command
- Guangzhou Sinovel interactive creates VR Exhibition Hall panoramic online virtual exhibition hall
- Go language installation and uninstallation
- Jsonp non homologous interaction (click trigger)
- QQ机器人官方插件加载配置方法【beta2版本】
- Leetcode-78-subset
- 3、 Hikaricp source code analysis of connection acquisition process III
- User management and permissions
猜你喜欢

Trend ea- fixed stop loss and profit per order

云上弹性高性能计算,支持生命科学产业高速发展、降本增效

On Oracle full stack virtual machine -- graalvm

Vulnhub range - darkhole 1

PostgreSQL user role permissions

Kotlin compose terminate todo project Click to edit and modify todo

Applet canvas generate sharing Poster

What is an operator?

Print 1 cute every 100 milliseconds ~ with a running lantern effect

Cutting feet to fit shoes - talking about the ramp reconstruction on the track
随机推荐
广州华锐互动VR全景为各行各业带来发展
PHP database connection version1.1
Cutting feet to fit shoes - talking about the ramp reconstruction on the track
Database data type design (the most detailed in the whole network)
Idea common plug-ins
Install spoole
R language uses the model of DALEX package_ The profile function interprets the relationship between a continuous feature and the target value Y in multiple classification models based on the conditio
QQ robot epidemic situation query / epidemic situation concern [latest beta2 version]
PostgreSQL division considerations
New features of php7
R language plot visualization: plot visualization of two-dimensional histogram contour (basic 2D histogram contour)
Server journey from scratch - Yu Zhongxian integrated version (IP access server, LNMP compilation and installation, Lua environment and socket expansion)
The functions in the applet page are better than those in app JS first execution solution
Solidity get quarterly time
Is it safe for tongdaxin to open an account?
PHP synchronizes website content to hundreds of websites to improve SEO ranking
Solidity contract address to wallet, wallet address to contract
2、 Hikaricp source code analysis of connection acquisition process II
Shell jump loop shift parameter left use of function
Embark on a new journey and reach the world with wisdom