I have a file on another server I want to open in the browser but this does not work:
Response.Redirect("\\\\ServerName\\Path\\File.pdf");
How can this be done?I know it would be best if the file was in a virtual directory on the same server as the asp.net app and use Server.MapPath() but is there any other way to get access across servers?
I think you may need the full physical path.
Just need to add "file://" to the start
"file://\\ServerName\\Path\\FileName"
Firstly the user trying to access the file must have access to the server on the internal network to be able to access the file directly via a browser.
If you want to serve a file from a server on your internal network to a user not on the same network (e.g. user connecting over the web) then you could use System.IO to stream the file to the browser. If this is what you want let me know and I can supply some sample code.
DJ
Saturday, March 24, 2012
Open a file on another server
Labels:
asp,
browser,
file,
net,
path,
pdf,
redirect,
server,
servername,
workresponse
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment