0

I want the preview of uploaded word document's in Angular. used iframe to load files , but files get downloaded instead of loading .

<p-dialog [(visible)]="displaydoc" [modal]="true" [responsive]="true">
    <div id="DocText">
        <iframe src = "URL" width='700' height='550' allowfullscreen webkitallowfullscreen>   </iframe>
</div>
</p-dialog>
Dora07
  • 70
  • 1
  • 7
  • Possible duplicate of [How do I render a Word document (.doc, .docx) in the browser using JavaScript?](https://stackoverflow.com/questions/27957766/how-do-i-render-a-word-document-doc-docx-in-the-browser-using-javascript) – Neil Lunn Mar 01 '19 at 09:40
  • I have tried code from given link , it's working for https , but not working for local path docs. (D:\\Sample\\Angular.docx) – Dora07 Mar 01 '19 at 10:24
  • I would strongly suggest actually including the code you "tried" from that example and/or any others. Right now you are not really showing what you are doing at all, and will likely be closed as a duplicate of that question unless you can show good reason why **your** question is *different*. Otherwise people will presume the existing answer is good enough. – Neil Lunn Mar 01 '19 at 10:27
  • How do you save docx files in the backend? I am getting content length zero and there is no binary data for it – ammad khan Nov 09 '22 at 07:18

0 Answers0