这是我渲染Word文档的代码:
function openDoc(documentPath, ext) {
var doc = "http://localhost:8080/content/target/cache/b3/96/04/b39604c5-be78-4c27-8b7e-a0fcf9c3587a.docx";
win.document.write('<iframe style="border:0; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%;" src=""></iframe>');
win.document.getElementsByTagName('iframe')[0].src = "https://view.officeapps.live.com/op/embed.aspx?src=" + doc ;
}
如果我直接转到“ http://localhost:8080/content/target/cache/b3/96/04/b39604c5-be78-4c27-8b7e-a0fcf9c3587a.docx”,则可以用Word打开文件,但是在Microsoft Office Viewer中,我收到“发生错误”。谁能解释我,为什么我不能在线打开此文件?