4

We have a problem allowing users on the same network to share links to shared network folders. Using ASP.NET, the code generated is as follows: <asp:HyperLink ID="HyperLink1" runat="server" NavigateURL="file://///server/network_folder/" />

Unfortunately, it doesn't have the desired effect that we wanted; it would do nothing when clicked, whether it is on IE8, Firefox (15.0.1), or Chrome (21.0.1180.89 m).

Looking around, I had found that it might only be possible to access it that way if the client browser has it set to allow permissions for the server (apparently, due to security reasons).

In order to save the hassle of having to go around and setting the permission for every client browser manually, is it possible to allow temporary permissions in the code-behind file (C#)?

Any other suggestions are welcomed.

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Siuki Chow
  • 41
  • 1
  • 2

2 Answers2

0

There seem to be security and implementation issues: HTML links to local network shares

However, you could create a simple asp .net request handler (ashx) file which could access the file in question, set the mime type, and return the file in the response stream. It would mean that the file would have to be sent to your web server and then transmitted again over http, but it's an option.

Community
  • 1
  • 1
Steven Hunt
  • 2,321
  • 19
  • 18
  • Also, take a look at the responses in the link I posted; there was mention of firefox and chrome plug-ins to help out with this problem. I don't know if that is an option in your organization... – Steven Hunt Sep 18 '12 at 15:40
0

Assuming the target folder is a simple Windows network share (rather than, for example, a WebDAV share, only Internet Explorer is going to be able to access it via the Windows credentials it can negotiate. Chrome, FireFox, et al do not auto-negotiate the Windows authentication protocol to provide the identity necessary to authorize access against whatever ACL's exist on the target folder.

As far as why the link fails even in IE, are you certain that the run-time link is actually as you are expecting? IF the link cannot be resolved, you should at least get a pop-up error message stating that the file or link couldn't be found, something of that nature. Getting no response at all is a bit curious.

David W
  • 10,062
  • 34
  • 60