0

I am working on a invoice report with my companies intranet. I would like to be able to link the invoice number to the actual invoice. My problem is that the file resides on a different server and not the web server.

When I'm on the computer I have to use the remote desktop connection to access the server to get to the files.

I've tried \SERVER\file_path.pdf and file:\\SERVER\file_path.pdf and neither works.

PlatiNUM
  • 99
  • 1
  • 9

2 Answers2

1

What you are doing is disabled by design. This sort of link to a local file will work in some browsers as long as the HTML is also called from a local file (ie file:///pageContainingLink). If not, it's a security vulnerability. It won't work at all in webkit based browsers.

See <A>nchor Link to Local File? (<a href='file:///{path}'>DEAD LINK</a> not working in FireFox but in IE)

And Cross-browser link to file on local system

If you want to get this to work, you'll need the other server to be a web-server too so that you can link to http://intranet2/fileYouWant.pdf

Community
  • 1
  • 1
AlexC
  • 1,091
  • 13
  • 25
  • +1 to Dany who got me thinking, you can't link to the file as is, but if you create a virtual directory and point at the other server, you can provide a plain old link from your webserver. I don't know what you are running. I'm out of practice in Apache, but in IIS it's trivial, just right-click on your site root and create a virtual directory. It's a little old, but here's a link for IIS: http://www.hosting.com/support/dedicated/iis/virtualdirectory – AlexC Feb 21 '12 at 16:14
  • I'll take a look at the link and try it out. – PlatiNUM Feb 21 '12 at 18:24
0

Try creating a symbolic link from the network share \SERVER\ to your machine --> X:\pathtoyourapacheroot\distantdocuments on your server machine

Then you should be able to use it just has if your file was on your machine x:\pathtoyourapacheroot\distantdocuments\file_path.pdf.

legrandviking
  • 2,348
  • 1
  • 22
  • 29
  • Actually, this still won't work as long as the webpage is served anywhere but locally, and only in a couple browsers if it is served locally. That said, Dany you got my thinker-upper running in a new direction. – AlexC Feb 21 '12 at 16:09