How to display a .docx file in iframe

Viewed 225

Currently, I need to display a word document with iframe but don't know how to make It work. My source path which is a Blob URL is:

var filePath = "blob:http://localhost:8080/b73d1841-5a54-416f-8931-7d5702a4dc7e"

When I put it into an iframe:

<iframe id="fileViewer" src={filePath}></iframe> 

It doesn't appear anything and return a warning:

Resource interpreted as Document but transferred with MIME type 
application/vnd.openxmlformats-officedocument.wordprocessingml.document: 
"blob:http://localhost:8080/....".

But If I use the same code with other type like pdf, It will work perfectly. Can someone pointout what I am missing ?

0 Answers
Related