在窗口浏览器中加载Word文档
我有一个页面动态链接到在新页面中打开的文档(该文档作为二进制数据存储在数据库中,我使用以下代码加载:
Response.ClearContent()
Response.ContentType = myReader("MIMEType").ToString()
Response.AddHeader("Content-Disposition", "inline; filename=" & myReader("Filename"))
Response.BinaryWrite(myReader("DocBD"))
Response.End()
这可以正常工作。但是,在加载文档之前,某些文档的访问权限受到限制输入用户名和密码后,用户将被重定向到登录页面。例如,如果是 pdf 文件,则会在同一登录页面中加载,但如果是 word 或 excel 文档,则会在浏览器外部打开。窗口和登录页面保留在后台是否有办法强制在浏览器窗口内打开 Word 或 Excel 文档?
I have a page that dynamically links to a document that opens in a new page (the document is stored in a database as binary data and I loaded using the following code:
Response.ClearContent()
Response.ContentType = myReader("MIMEType").ToString()
Response.AddHeader("Content-Disposition", "inline; filename=" & myReader("Filename"))
Response.BinaryWrite(myReader("DocBD"))
Response.End()
This works ok. However some documents have restricted access and before loading the document the user is redirected to a login page. After entering username and passowrd the document is loaded. If it is a pdf file for example, it loads in the same login page, but when it is a word or excel document it opens outside the browser window and the login page remains in the background. Is ther a way to force a word or excel document to open inside the browser window?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于 Word 的工作方式,我的猜测是否定的。每个文档(我认为它考虑了登录本身)都在不同的窗口中打开。
My guess would be no, due to the way Word works. Every document (and I think it consider the login as such) is opened in a different window.
您将需要一个为网络浏览器显示 Word 文档的插件。
您使用的 PDF 阅读器(Acrobat?)有一个浏览器插件,它不是呈现内容的浏览器。
You will need a plugin that shows Word documents for the webbrowser.
The PDF reader you are using (Acrobat?) has a browser plugin, its not the browser that renders the content.