是否可以从浏览器外部的共享文件夹中打开文件
我们有一个用于 Intranet Web 应用程序的文件处理 ASP.Net Web 控件,当前使用 ActiveX 来处理文件签出和签入。在 IE&Win 中工作正常。 但现在我们正试图摆脱 ActiveX 和 ActiveX。仅限 IE 的行为...
如果检出文件,则会将其复制到文件共享,访问权限仅限于检出用户。 使用隐藏的 iframe,并将 iframe 的 src 设置为“file:////file_share/dictionary/users_stuff/someDoc.doc”之类的内容,会显示一个打开/下载对话框,以便用户可以打开和编辑共享的文件直接从文件共享中保存 Word、Excel 等文件。
适用于浏览器无法处理自身的文件类型。
但对于 txt、图像、html 等文件类型,浏览器只需将文件加载到 iframe,或者打开文件(如果向用户提供链接)。如果不手动启动相应的应用程序并复制 URL,用户就无法编辑该文件。向用户显示“将此 url 复制到您首选的应用程序,并尝试编辑它”并不是真正的用户友好...
我的问题是:是否可以让浏览器(没有 ActiveX、IE...)通过到操作系统的链接,或者显示某种“您想用这个文件做什么”对话框?
如果没有,可以实现什么以及如何实现?
We have a file handling ASP.Net web control used in intranet web applications, that currently uses ActiveX to handle file check-outs, and check-ins. Works fine, in IE&Win.
But now we are trying to get rid of ActiveX & IE only behavior...
If a file is checked out, it is copied to file share, with access right limited to the checking-out user.
Using a hidden iframe, and setting the src of the iframe to something like "file:////file_share/dictionary/users_stuff/someDoc.doc", an open/download dialog is shown, so the user can open and edit the shared file in Word, Excel, etc directly from the file share.
Works fine for file types browsers can't handle themselves.
But for file types like txt, images, html the browser simply loads the file to the iframe, or opens the file, if the user is given a link. And the user can't edit the file without manually launching the appropriate application and copying the url. Showing the users a "Copy this url to your preferred application, and try to edit it" would not be really user friendly...
My question is: is it possible to get the browser (without ActiveX, IE...) to pass the link to the OS, or show a "What do you want to do with this file" dialog of some sort?
If not, what and how could be achieved?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能想到的最接近的是这个线程:
https://stackoverflow.com/a/1394725/1195927
@Red 说不(原海报也同意)但是@ Daan 似乎有一个解决方案。
我还没有测试过,所以 YMMV。
如果没有找到 javascript/html 解决方案,我可能会为您提供一个丑陋的 hack。 。 .
请参阅我的帖子:启动可下载链接
The closest I could come up with is this thread:
https://stackoverflow.com/a/1394725/1195927
@Red says no (and the original poster agrees) BUT @Daan seems to have a solution.
I have not tested, so YMMV.
If a javascript/html solution is not found, I may have an ugly hack for you . . .
See my post here: Launching a Downloadable Link