在窗口浏览器中加载Word文档

发布于 2024-09-05 20:52:18 字数 475 浏览 1 评论 0原文

我有一个页面动态链接到在新页面中打开的文档(该文档作为二进制数据存储在数据库中,我使用以下代码加载:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凶凌 2024-09-12 20:52:18

由于 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.

爱你不解释 2024-09-12 20:52:18

您将需要一个为网络浏览器显示 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文