// 下載doc url let href = “base64編碼” let fileName = "文件名.doc // 下載 doc this.http.get(href, { observe: 'response', responseType: 'blob', }).subscribe(res:Blob => {
// 返回的數據流為Blob const file = decodeURIComponent(fileName); this._FileSaverService.save(res.body, file); this.isDownload = false; }, err => { this.isDownload = false; this.message.create('error', '下載失敗!'); });