1

I have embedded Google Docs preview in my Rails application. While using AWS S3 signed URL, it does not generate preview. How can I solve this problem?

Example

<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>
Racil Hilan
  • 24,690
  • 13
  • 50
  • 55
Prakash
  • 676
  • 6
  • 22
  • That's not an S3 signed URL. It's a CloudFront signed URL, which potentially makes this question quite a bit different. (I assume the origin server behind CloudFront is S3 but that's probably not actually going to be significant). What do you see in the CloudFront access log? Is access being attempted but denied, or...? – Michael - sqlbot Sep 13 '16 at 08:15

1 Answers1

2

I think the s3/cloudfront url does not encoded. Try with encoded url.

the url should be https%3A%2F%2Fd2qvdh0r9424ok.cloudfront.net%2Fmallow-tech%2Fattachments%2F1%2Foriginal%2Flogo-page.png%3F1473416934 instead of https://d2qvdh0r9424ok.cloudfront.net/mallow-tech/attachments/1/original/logo-page.png?1473416934

Satheesh
  • 36
  • 5