简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM