Search code examples
asp.netiisfilepathnetwork-driveweb-publishing

Files on network drive are not accessible when website is published on IIS


I have a website that shows a list of recommended documents retrieved from a network drive, Z drive. for each document, if the user pushes a button, he can navigate to the path of the file through windows explorer. below is the code.

 string argument = @"/select, " + filePath;
     System.Diagnostics.Process.Start("explorer.exe", argument);

an example of filepath is : z:\ecomarathon2012\04-Reports\fuel cell and batteries comparative.docx

Now, I have published the website on IIS but the button does not work anymore to show me the path of the file. What changes I need to add in order to solve this problem for the published version of the website?


Solution

  • Sounds like your IIS user identity doesn't have access to the network drive. Give that user read access and I believe your code should work. If not, try to log some errors using try catch and post them here.