Reputation: 1106
I am trying to copy a file from a child directory of my root directory of the website to another root level directory
from someDir\root\child1\child2\file.jpg to SomeDir\testDir\file.jpg
but it gives me error Access to the path 'C:\Users....' is denied.
Same code works just fine on production server, so I believe its some IIS environment variable but dont know which one.
I have full access on those directories with all my accounts and no error in path writing either...I am running IIS 7 & production server is IIS 6
Help???
Upvotes: 0
Views: 462
Reputation: 88064
The first thing to check is: What user is your code actually executing under?
Specifically, what is the Application Pool running under?
Typically this is going to be Network Service, Local System, an App Pool Identity, or similar. Rarely is it one of your accounts. Verify that the identified user actually has the appropriate rights to the target directory
Upvotes: 1