需要在响应头设置对应的头部,让浏览器知道当前的资源作为附件下载,而不是显示在页面上
const headers = {
'Content-Type': 'image/png',
'Content-Disposition': 'attachment; filename=example.png',
};
关键词:图片下载
需要在响应头设置对应的头部,让浏览器知道当前的资源作为附件下载,而不是显示在页面上
const headers = {
'Content-Type': 'image/png',
'Content-Disposition': 'attachment; filename=example.png',
};
关键词:图片下载