tags:

views:

67

answers:

3

Conditions: The files must be opened outside of the window that the link to them is in.

I have tried href, but when I give it an intranet link it only opens correctly if I leave out target="_blank"; if I put that in, the new window that opens doesn't receive the full link if there is a pound sign in the filepath... a direct link to the intranet address \a\b\c#c.txt would be fine with me; there is no concern about security, but I can't seem to get that to happen in a new window. It seems like this is happening when I don't create a new window, but I can't utilize the same window to open the links.

Any ideas?

+1  A: 

It's a bit of a hack but try changing the links to href="#" onclick="window.open('http://' + escape(restofurl))"

Ben Robinson
Even after trying that, clicking the link which opens a new window shows the whole correct link for a moment in the address bar (just a quick flash) while opening before changing to the link to everything up to (but not including) the '#' and then failing. Perhaps I'm having a browser issue...?
Christopher Horenstein
If the link starts out correct then changes it sounds like your bit is working and something else is changing it.You are either having a browser issue or there is some kind of further redirect in the page you are redirecting to.
Ben Robinson
A: 

Have you tried streaming the file contents to the browser?

Antony Scott
+1  A: 

Even if you can get the link to work, the user accessing it may or may not have rights to see that machine.

What I do in cases where I have to link to other files on other server, is link to a generic handler(.ashx file) that does impersonation of user that does have rights, or impersonates the logged-in user. The handler then reads the contents of the file and streams it to the user.

Ed B