Google文档预览不会显示S3签名网址

时间:2016-09-13 03:51:26

标签: iframe amazon-s3 amazon-cloudfront

我已在我的Rails应用程序中嵌入了Google文档预览。使用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>

1 个答案:

答案 0 :(得分:2)

我认为s3 / cloudfront网址没有编码。尝试使用已编码的网址。

网址应为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