I try to display a .doc file stored on a S3 bucket inside an iframe thanks to google doc viewer api.
I already did some research and found this, which i tried to apply here :
var encodedUrl = encodeURIComponent("http://myAPI.com/1d293950-67b2-11e7-8530-318c83fb9802/example.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256%26X-Amz-Credential=GNRO0BLDYAJP1FU7ALIS%2F20170717%2Fus-east-1%2Fs3%2Faws4_request%26X-Amz-Date=20170717T145429Z%26X-Amz-Expires=600%26X-Amz-SignedHeaders=host%26X-Amz-Signature=ee556c5c92427bb38265507218a701660936bc2774ecc919648bb2d780a2619f");
$scope.selectedSource = $sce.trustAsResourceUrl(
"http://docs.google.com/gview?url=" + encodedUrl + "&embedded=true"
);
Iframe looks like :
<iframe ng-src="{{selectedSource}}" frameborder="no" style="width:100%;height:100%"></iframe>
But i still get a "No Preview Available" from the viewer inside the iframe , any idea why ?
I specify that the signed url (not encoded) works when I paste it in my browser, so I have all the rights needed.