谷歌文档的预览不显示S3签名网址(Google Docs preview does not show

2019-09-29 03:20发布

我在我的Rails应用程序中嵌入谷歌文档的预览。 在使用AWS S3标识的URL,它不产生预览。 我怎么解决这个问题?

<iframe src="http://docs.google.com/gview?embedded=true&amp;url=https://d2qvdh0r9424ok.cloudfront.net/mallow-tech/attachments/1/original/logo-page.png?1473416934&amp;Expires=1473738491&amp;Signature=CsFJAs6jg8pqDSMy3YTinV7a8ffYoRUpc~0D-cEgw-hXWQ96fV7VYUz3uDmDmf7O2MeGEFnVt2aiwPgcsqEA8Up~azeCoBUUraKVr~fPLrl-xrWofuIzR7iZSqqsr6mQedMlWOIHbS3S9XIsJY8j74L2po-U04oM6dylSrF~CKPAwgpf4uQGeuPx1mj7My5ikIipfXJmU1MQ-ePVvWY3rRLPCFS~p9YBAQBXPsN4~P3vrx91qLcoTfjfXWDOlMbuIwNsQw8DnC6pfn1o9gsoB0dyZ6yU5iM5-oPDlxv8BV1nfaF8GmKhyDZkn0w663IRlkMMmwypQUYCMhd~Oe2PVQ__&amp;Key-Pair-Id=APKAJNWWFIAEHGHR4NAQ" style="width:600px; height:500px;" frameborder="0"></iframe>

Answer 1:

我觉得S3 / CloudFront的网址不编码。 试着用编码的URL。

网址应为https%3A%2F%2Fd2qvdh0r9424ok.cloudfront.net%2Fmallow-tech%2Fattachments%2F1%2Foriginal%2Flogo-page.png%3F1473416934代替https://d2qvdh0r9424ok.cloudfront.net/mallow-tech/attachments/1/original/logo-page.png?1473416934



文章来源: Google Docs preview does not show S3 Signed URL