我的项目基于 Node.js(后端)和 AngularJs(前端),因此我想在我的网页中打开 Office 文件(.doc .ppt 等)。我的文件存储在 Amazon s3 服务器中。我想在我的网页中打开这些文件。
所以我需要类似谷歌驱动器的功能来查看文件。
有什么想法吗?
最佳答案
如果您只想查看,可以通过 <iframe>
使用 Google 文档查看器或通过 <iframe>
访问 Microsoft Office 365 查看器.
<iframe src="http://docs.google.com/gview?url=http://remote.url.tld/path/to/document.doc&embedded=true"></iframe>
或
<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=http://remote.url.tld/path/to/document.doc' width='1366px' height='623px' frameborder='0'>This is an embedded <a target='_blank' href='http://office.com'>Microsoft Office</a> document, powered by <a target='_blank' href='http://office.com/webapps'>Office Online</a>.</iframe>
从How do I render a Word document (.doc, .docx) in the browser using JavaScript?获得的解决方案
关于javascript - 如何像google Drive一样在网页中查看office文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48059473/