Associating with a network folder in ASP.NET

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

Unfortunately, it does not have the desired effect that we wanted; he would not do anything when pressed, whether on IE8, Firefox (15.0.1) or Chrome (21.0.1180.89 m).

Looking around, I found that access to it can only be possible if the client browser is configured to allow permissions for the server (apparently due to security reasons).

To get rid of the need to walk around and set the resolution for each client browser manually, is it possible to allow temporary permissions in a file with code (C #)?

Any other suggestions are welcome.

+4
source share
2 answers

Security and implementation issues seem to be: HTML links to network shares

However, you could create a simple asp.net request handler (ashx) file that could access the corresponding file, set the mime type, and return the file to the response stream. This would mean that the file must be sent to your web server and then transferred again via http, but this is an option.

0
source

Assuming that the destination folder is a simple Windows network share (and not, for example, a WebDAV share, only Internet Explorer will be able to access it through the Windows credentials with which it can agree. Chrome, FireFox and others do not automatically negotiate the protocol Windows authentication to provide the authentication information necessary to authorize access to any ACL in the target folder.

As for why the link crashes even in IE, are you sure that the link at run time is actually the same as you expect? If the connection cannot be resolved, you should at least get a pop-up error message indicating that the file or link could not be found, something like that. Getting the answer is quite a bit.

0
source

Source: https://habr.com/ru/post/1434874/


All Articles