google docs viewer is not working for some url

2.4k Views Asked by At

I am using google doc viewer to embed the document in the website.

The below code is working fine for most of the URL. But it not working for the below url. https://www.googleapis.com/download/storage/v1/b/myrefers-prod-resumes/o/RagulRaj%5B0_10%5Dwo3ROygrYW.doc?generation=1483615756991284&alt=media

Please suggest why the below code is not working for the above URL.

<iframe src='http://docs.google.com/viewer?embedded=true&url=www.snee.com/xml/xslt/sample.doc' width='500px' height='350px' frameborder='0'>Test</iframe>
1

There are 1 best solutions below

0
On

To embed a Google doc, sheet, slide or form, you have to publish it on the web first and then obtain the 'embed link'. After that you can now use it on websites. That instruction is found here under "Embed files".

Since you're on Google docs, do this: File -> Publish to the Web -> Embed

Copy the whole code and embed it in your website. It looks like this: enter image description here