admin管理员组文章数量:1315225
I'm trying to use ngx-doc-viewer to display documents stored in Amazon S3 using presigned URLs, but I keep running into issues when trying to preview them via Google Docs Viewer and Office Online.
What I Tried:
I generated a presigned URL from S3 and tested it in the browser.
I passed the encoded presigned URL to ngx-doc-viewer using Google Docs Viewer:
var encodedUrl = encodeURIComponent(presignedUrl);
var iFrameUrl = '=' + encodedUrl + '&embedded=true';
Error: "No Preview Available"
I tried using Microsoft Office Online:
var iFrameUrl = '.aspx?src=' + encodedUrl;
Error: "File is not publicly accessible"
I also tested ngx-doc-viewer's built-in URL viewer option, and instead of previewing the file, it downloads it. This suggests that the file is accessible, but the viewers fail.
I found this blog post discussing the exact same issue. They resolved it by encoding the presigned URL with encodeURIComponent(), but this solution did not work for me.
Questions: Why are Google Docs Viewer and Office Online failing to preview my S3 presigned file, even though the URL is accessible? Has anyone successfully previewed S3 presigned URLs in ngx-doc-viewer using these services? Is there an alternative document viewer that supports private S3 URLs without requiring the file to be fully public? Any insights would be greatly appreciated!
本文标签:
版权声明:本文标题:html - Google Docs Viewer and Office Online Not Displaying Document on S3 Presigned URL in ngx-doc-viewer - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741981233a2408407.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论