我正在实施一个saveas对话框,如下所示:
this.http.get(targetUrl,{responseType:ResponseContentType.Blob})
.catch((err)=>{return [do yourself]})
.subscribe((res:Response)=>{
var a = document.createElement("a");
a.href = URL.createObjectURL(res.blob());
a.download = fileName;
// start download
a.click();
})
文件已保存,但saveas对话框未显示。 我该怎么办才能让它出现?
感谢您的帮助。