Serhiy
Serhiy

Reputation: 1981

Why .doc automaticly downloads, but not shown in <iframe>?

The problem is - when I input url with .png or .pdf it has been shown in iframe>. I can scroll it, read etc. But when I insert an url which has docx or xls file (ex. "http://www.exampleimage.docx") - it automatikly aploads by browser, and not shown in iframe>.But i want to see content of .docx file in iframe like i do with pdf. What to do or where to search guys?

here is part of my code:

 <iframe   src={{attachmentUrl}} width="468" height="468" frameborder="0">
    Click on attachment please.
</iframe>

Upvotes: 0

Views: 1512

Answers (1)

Sania Khushbakht Jamil
Sania Khushbakht Jamil

Reputation: 822

You can edit your url i.e, "https://docs.google.com/gview?url=${YOUR_URL}&embedded=true" and then add to iframe:

 <iframe
   className="doc"
   src={`https://docs.google.com/gview?url=${YOUR_URL}&embedded=true`}
 />

Upvotes: 3

Related Questions