为什么不能在以下演示中打开链接:http:
//html5-demos.appspot.com/static/a.download.html
您甚至无法右键单击并在新选项卡/窗口中打开它.我需要自定义浏览器中的任何设置吗?
我当然是一个AngularJS新手,但我无法找到为什么这个代码在Chrome和Firefox中有效,但"Access is denied"在IE 11的javascript控制台中给出了.
我需要通过经过身份验证的REST调用来显示PDF.理想情况下,这将显示在弹出(预览)类型的窗口中.
到目前为止,代码如下:
$http.post( url, payload, {
headers : {
"Authorization": token
},
responseType: "arraybuffer"
}).success(function ( data ) {
var file = new Blob( [ data ], { type: 'application/pdf' });
var fileURL = URL.createObjectURL( file );
window.open( fileURL );
}
Run Code Online (Sandbox Code Playgroud)
在window.open()给出了"access is denied"对IE11的消息,但在Chrome和Firefox的作品.我尝试改为window.location(),并得到了同样的错误.
这不是跨域问题(一切都在同一个foo.net域中).
此应用程序用于从数据库收集信息并从中生成.pdf文件.
this.reportsService.getTelerikReport({ reportId: this.selectReportId, startDate: this.startDate, endDate: this.endDate, ReportItems: listCheckItems})
.then(response => {
this.fileLoading = false;
var file = new Blob([response], { type: "application/pdf" });
this.fileUrl = this.$sce.trustAsResourceUrl(URL.createObjectURL(file));
this.isReportGenerated = true;
Run Code Online (Sandbox Code Playgroud)
我只在Microsoft Edge控制台中收到错误.很多人说这是Edge浏览器的安全问题.
有人能为我提供帮助吗?