1

signed url of cloud storage object in gcp not working with google or microsoft doc viewer in iframe .

<iframe id="iframe-tag" src="https://docs.google.com/viewer?url=https%3A%2F%2Fstorage.googleapis.com%2Futkarsh-video-bucket%2Fsample.docx%3FExpires%3D1579189477%26amp%3BGoogleAccessId%3Dvideo-streaming-258309%2540appspot.gserviceaccount.com%26amp%3BSignature%3Dlr4j6y7768p3Z50ttJu%252Bi3bZ1FmaesQsMySHNNO%252FA7bHJObLloFiU2VtOYaDjxXwfuvO5x1Xmd2hD1A8ZTZMpP9WGDM1Z7W1m4oWqI%252FFJHspNhYm00Hr9rdlBORpGWjGYtogfDPIbXs2v4tHDyO%252BluEVQJwZN4b0mW1bKc3q5FYbFi3cQTTf7IXE5trbymiln4coakd9R%252FIIv2Ii9a%252F%252FdtLx0KB6N5u3j1oGEoj6t%252FfONLQ7bHQ5xEDY%252F7IWPPNkErIV%252BiKPgYqNVeQ04dqUC9Z0Mzcm1LpVK%252FsUX1TPSH2Ear8vIcX9fh15znCLvOg3OewYuR5PLPmsCXOueh4cOg%253D%253D&amp;embedded=true"></iframe>

it can be downloaded through browser.

  • How did you create the signed URL? – iker lasaga Jan 16 '20 at 16:00
  • V4 signed URLs api – Utkarsh Shende Jan 16 '20 at 17:33
  • Would you mind sharing a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the code used (without sharing any sensitive information) to create the signed URLs? Also specify which programming language you are using. I noticed that the URL you are giving replaces all the `/` and `:` signs with their respective [URL encoding](https://www.w3schools.com/tags/ref_urlencode.ASP), while on other [examples](https://stackoverflow.com/questions/27957766/how-do-i-render-a-word-document-doc-docx-in-the-browser-using-javascript) I don't see they are replaced. – Daniel Ocando Jan 17 '20 at 09:44
  • Hello @UtkarshShende: Did you find a solution. I am generating the URL via `getDownloadURL` method of google storage. However, docs viewer is throwing cannot reach error. Thanks – RmR Jul 30 '20 at 02:53
  • Hello @RmR, signed URL generated needs to be converted into base64 format, for the browser to understand it properly. – Utkarsh Shende Aug 23 '20 at 13:46
  • Thanks @UtkarshShende. Will give it a try – RmR Aug 24 '20 at 09:10

0 Answers0