文件URL或如何从URL打开文件夹 [英] File URLs or how to open folder from URL

查看:637
本文介绍了文件URL或如何从URL打开文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Intranet上有几个用户,所有用户都有到服务器(E :)的映射驱动器. 所有用户都在Win7上并使用FireFox. 我在服务器上使用XAMPP来允许用户使用PHP访问MySQL文件. 他们目前使用Windows资源管理器在(E :)上打开一个文件夹,以便保存/修改文件(jpg,docs等). 我想在html中放置一个链接,以便为他们打开该文件夹.

I have several users on an intranet and all have a mapped drive to server (E:). All users are on Win7 and use FireFox. I have used XAMPP on the server to allow users access to MySQL files using PHP. They currently use windows explorer to open a folder on (E:) so save/modify files (jpgs, docs etc.). I want to put a link in the html to open this folder for them.

我花了一些时间研究此问题,并获得了不同程度的成功,并且发现这可能存在诸如...

I've spent some time researching this with varying amounts of success and I have found out that this may have security issues such as...

Web应用程序无权访问本地计算机的文件系统

但是这些都是访问本地Intranet上同一服务器的所有客户端.

but these are all clients accessing the same server on a local intranet.

我可以输入...

file:///C:/MyFolder/MySubFolder/

在我的浏览器地址栏中的

会打开一个页面,其中包含子文件夹中文件的目录列表.不是很理想,但解决方案只占一半!

in my browser address bar which opens a page with a directory listing of the files in the sub folder. Not ideal but half way to a solution!

但是下面的脚本不起作用...

But the script below does not work...

window.open("file:///C:/MyFolder/MySubFolder/");

可以做到吗?

推荐答案

如果链接使用五个斜杠(file://///C:/MyFolder/MySubFolder/) 且用户具有禁用了通过HTTP服务的页面中file:链接的安全限制.

Firefox will work if the link is in its own mangled form using five slashes (file://///C:/MyFolder/MySubFolder/) and the user has disabled the security restriction on file: links in a page served over HTTP.

检查帖子以获取更多信息

check this post for more info

这篇关于文件URL或如何从URL打开文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆