js - 流文件

js - 流文件

图片流显示

let imgSrc = window.URL.createObjectURL(new Blob([res]))

流文件下载

// ie10+
let blob= new Blob([res]),
name=row.theme_name+'.jpg'
if (navigator.msSaveBlob) {
return navigator.msSaveBlob(blob, name);
} else {
var link = window.URL.createObjectURL(blob);
var a = document.createElement('a');
a.href = link;
a.download = name;
a.click();
}
posted @   zc-lee  阅读(118)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示