2

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?

Acoustic Jack
  • 107
  • 3
  • 14
  • please have a look over here : http://stackoverflow.com/questions/5796215/an-url-to-a-windows-shared-folder – Tharif May 12 '15 at 07:23
  • here is your answer http://stackoverflow.com/questions/855614/what-are-the-ways-to-make-an-html-link-open-a-folder – Tharif May 12 '15 at 07:31
  • I spent a few hours looking at some of these suggestions and just got more confused. Either it can't be done or I may need to change FF configs. It would be great if someone could just post a fiddle or some kind of example to show me how to use window.open("file:///C:/MyFolder/MySubFolder/"); If I can see this working I should be OK – Acoustic Jack May 12 '15 at 07:59

2 Answers2

0

you path would be

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

or

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

use absolute path for this

Saty
  • 22,443
  • 7
  • 33
  • 51
  • Can you please explain how your suggestions should be modified to simulate ' window.open("file:///C:/MyFolder/MySubFolder/"); ' ? – Acoustic Jack May 12 '15 at 08:01
0

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

Community
  • 1
  • 1
miltos
  • 1,009
  • 1
  • 6
  • 10