dongna1593 2015-05-12 07:19
浏览 297

文件URL或如何从URL打开文件夹

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

A web application does not have access to the local machine's filesystem

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

I can type...

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/");

Can this be done?

  • 写回答

2条回答 默认 最新

  • dpf56454 2015-05-12 07:21
    关注

    you path would be

    window.open("http://localhost/MyFolder/MySubFolder/");
    

    or

    window.open("http://IP/MyFolder/MySubFolder/");
    

    use absolute path for this

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题