I am trying to view the .doc extension files with google doc viewer using an iframe in my web app.
Here is the code :
<iframe src={"https://docs.google.com/viewer?url=" + this.state.file + "&embedded=true"} id="frame-id" allowFullScreen={true}/>
this.state.file has the url =
url=http://localhost:8000/media/somefolder/amO3N9pP/someusers/jEARG7xb/someassignments/amO3N9pP/1/file-sample_1MB.doc&embedded=true
localhost 8000 is my backend server which is up and running.
When the user clicks on the .doc file in the website, the preview is blank and the file is forced to download.
I viewed the activity in my network tab. I can see the url of the file which is fine.
When I click on the file the status gets cancelled in the network tab and then its force download with status 200.
Any suggestions ?