I want to open Documents from Shared Folder on network using ASP.NET with C#. My situation as follow:
- My Web Server Name is “WebServer1” use IIS 7
- My DC Server Name is “DC1”
- My File Server Name “FileServer1”
- My Files Path
\\FileServer1\A\B\C\MyDoc.docx
and\\FileServer1\A\B\C\MyPDF.pdf
I tried the following
1- I Created Hyper Link
<a href="file:///// FileServer1\A\B\C\MyDoc.docx" target="_blank">link to file</a>
The files open on some machines that uses Internet Explorer version 8 but on any other version or Chrome, Fire Fox, or any other web browser it doesn't work when I click on the hyper link no action happens and no errors, but if I copied the link address and pasted it into the web browser the file opens
I gave the path in the file server full control permission for “everyone”
2- I also tried to create a button with the following code
Response.ContentType =
"application/vnd.openxmlformats- officedocument.wordprocessingml.document";
Response.AppendHeader("Content-Disposition", "attachment; filename=5401-1-2289.docx");
Response.Redirect("file:///// FileServer1\A\B\C\MyDoc.docx");
Response.Flush();