Open file in intranet from another server - ASP.Net C# -
i have problem. webapp have open file local resource on server in browser , if it's not supported browser open associated program. exapmle pdf, docx, xlsx files. path server stored in db this: \server2\folder\file.pdf
i have tried albe find , found there's no solution. need figured out.
my app asp.net ajax, c# , telerik components
what tried:
- <a href="\\server2\folder\file.pdf">link</a> - <asp:hyperlink id="hyperlink1" runat="server" navigateurl='<%# eval("link") %>' target="_blank">hyperlink</asp:hyperlink> - responce.redirect(path)
it doesn't work , responce chrome this:
not allowed load local resource: file://server2/folder/file.pdf
is there way?
edit - modified specification of problem
if client accessing link outside internal network, need open file on server side , stream client. require linking new page in server app path want, , using new page stream file client. example, link this:
<a href="/downloadfile.aspx?path=\\server2\folder\file.pdf">link</a>
then in downloadfile.aspx codebehind have this:
var path = request.querystring["path"]; response.writefile(path);
c# asp.net hyperlink
No comments:
Post a Comment