• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1061
  • Last Modified:

IIS Could not find a part of the path

Calling this code from C# web app:
                            return File(path, "application/msexcel",trimmedPath);

Open in new window

If I run in Visual studio the command works and the file is downloaded.  If I run on the server I get this error
Could not find a part of the path 'r:\results\19262\19262-BA-T1\19262-BA-T1-19262-BA-T1-2_12_11_2014_32C_CST_8870.xlsx'.

Open in new window

If I copy that path into explorer it opens on the server
In IIS I have set Physical path credentials to my userID
0
Lab Guy
Asked:
Lab Guy
  • 4
1 Solution
 
Michael FowlerSolutions ConsultantCommented:
I am assuming that r is a mapped network drive. Try using the network path instead eg \\server\....
0
 
Lab GuySystems Integration EngineerAuthor Commented:
Tried that as well, get this error:
Access to the path '\\servername\rts\results\19262\19262-BA-T1\19262-BA-T1-19262-BA-T1-2_12_11_2014_32C_CST_8870.xlsx' is denied.

Open in new window

0
 
Lab GuySystems Integration EngineerAuthor Commented:
With the UNC method, here is the Proc Mon info:Process Mon
0
 
Lab GuySystems Integration EngineerAuthor Commented:
Resolved it.  Issue was that the process was running under the application pool user credentials. Switched it to the NETWORK SERVICE user and it worked.
0
 
Lab GuySystems Integration EngineerAuthor Commented:
Figured it out with help from another source
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now