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 @ 2022-01-10 09:15  zc-lee  阅读(116)  评论(0编辑  收藏  举报