Starr Duskk
asked on
Access to the path <path> is denied: Delete Permissions not working.
In my website, I want to delete a directory and all subdirectories.
I get the error on a file name: Access to the path <path> is denied
In my IIS7 App Pool I am using ApplicationPoolIdentity. I do not have <identity impersonate="true" /> in my <system.web>
Someone recommended enabling ASP.NET Impersonation and setting it to Authenticated User. I did that and restarted the website. Didn't help.
In IIS7, I right-click my uploads directory and set the permissions for "Users" role to include everything, including Delete. Is Users role even the correct role?
I have set it to replace child permissions, etc.
I just can't get it to allow me to delete the directory or the files within the directory.
I initially tried to delete the directory (and all in it). That errored. So I now loop through the files in the directory and the directories in the directory to remove the files first, then the empty directory, but now it won't even let me delete one little file.
It works locally on my development machine, but not remotely.
Any ideas?
thanks!
I get the error on a file name: Access to the path <path> is denied
In my IIS7 App Pool I am using ApplicationPoolIdentity. I do not have <identity impersonate="true" /> in my <system.web>
Someone recommended enabling ASP.NET Impersonation and setting it to Authenticated User. I did that and restarted the website. Didn't help.
In IIS7, I right-click my uploads directory and set the permissions for "Users" role to include everything, including Delete. Is Users role even the correct role?
I have set it to replace child permissions, etc.
I just can't get it to allow me to delete the directory or the files within the directory.
I initially tried to delete the directory (and all in it). That errored. So I now loop through the files in the directory and the directories in the directory to remove the files first, then the empty directory, but now it won't even let me delete one little file.
It works locally on my development machine, but not remotely.
Any ideas?
thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yes, I know how to setup the application pool identity.
My question is WHAT USER DO I SETUP when I click the security tab?
I am setting up the "USER" account.
My question is WHAT USER DO I SETUP when I click the security tab?
I am setting up the "USER" account.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
As I said in a previous mail...
>>Anonymous authentication is IUSR in IIS7, but when I go to set permissions, IUSR is not one of the users in the list.
When I click on the link to add, iis_isrs group is not an option either.
From right clicking the folder and going to the Security tab, my Group or User Names options are:
CREATOR OWNER
SYSTEM
FTPUsers
Administrators
Users
TrustedInstaller
And I am setting the permission for Users.
This directory and I have other directories that I have set the permission for Users to write and that works fine.
It's the deleting of the folder and files that fails.
My User has Modify, Read & Execute, Write from the main screen.
If I drill into it, it shows that this folder and subfolders and files also has:
Delete subfolders and files
and Delete.
>>Anonymous authentication is IUSR in IIS7, but when I go to set permissions, IUSR is not one of the users in the list.
When I click on the link to add, iis_isrs group is not an option either.
From right clicking the folder and going to the Security tab, my Group or User Names options are:
CREATOR OWNER
SYSTEM
FTPUsers
Administrators
Users
TrustedInstaller
And I am setting the permission for Users.
This directory and I have other directories that I have set the permission for Users to write and that works fine.
It's the deleting of the folder and files that fails.
My User has Modify, Read & Execute, Write from the main screen.
If I drill into it, it shows that this folder and subfolders and files also has:
Delete subfolders and files
and Delete.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I did this, and went to special permissions and added delete and delete folders and I get exactly the same error again.
When I run the code to delete the file I the directory, I get the error:
Deleting Folder: C:\inetpub\ftproot\xxx\xxx \688\Conte nt/
Access to the path xxx.js' is denied.
I can upload and read and write from this directory, but not delete.
I suspect it's not an iusr issue since, I was using USER before and I wouldn't have been able to write to it if my permissions were wrong. But neither user allows deletion.
thanks!
When I run the code to delete the file I the directory, I get the error:
Deleting Folder: C:\inetpub\ftproot\xxx\xxx
Access to the path xxx.js' is denied.
I can upload and read and write from this directory, but not delete.
I suspect it's not an iusr issue since, I was using USER before and I wouldn't have been able to write to it if my permissions were wrong. But neither user allows deletion.
thanks!
ASKER
Any other suggestions?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Is this in the application event log?
There is this, but it just doesn't seem to have anything to do with deleting a file:
+ System
- Provider
[ Name] ASP.NET 4.0.30319.0
- EventID 1309
[ Qualifiers] 32768
Level 3
Task 3
Keywords 0x80000000000000
- TimeCreated
[ SystemTime] 2013-08-15T20:41:29.000000 000Z
EventRecordID 12744336
Channel Application
Computer xxx
Security
- EventData
3012
An error occurred processing a web or script resource request. The resource identifier failed to decrypt.
8/15/2013 3:41:29 PM
8/15/2013 8:41:29 PM
887f8d1bb39e4bdbb4c178b484 d1191a
80005
834
0
/LM/W3SVC/2/ROOT-1-1302102 6560054000 0
Full
/
C:\inetpub\ftproot\xxx\
xxx
1320
w3wp.exe
NT AUTHORITY\SYSTEM
HttpException
Unable to validate data. at System.Web.Configuration.M achineKeyS ection.Enc ryptOrDecr yptData(Bo olean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType, Boolean signData) at System.Web.UI.Page.Decrypt String(Str ing s, Purpose purpose) at System.Web.Handlers.Assemb lyResource Loader.Sys tem.Web.IH ttpHandler .ProcessRe quest(Http Context context)
http://xxx.com/WebResource.axd?d=6ol4SXiyVX-Ti1WL3-8x3yud-XxlNVpc9WYXuSCtsFE844m5tyywqkMN8r-28s3tCRqAGRrM0LEmyFRuWuubl-FlH3feU8SxMi2tgD1Fhjgo99EXNd5qjYODHfJTDEVfe8wkee2QtApI2APrPbs04mNrj2MGUP6Vad167y9ye616evP65cu2Yl4HAPHULDunJ_WPYO6vYce85NXxEc65Fg2&t=635060488569420000
/WebResource.axd
108.34.100.142
False
NT AUTHORITY\IUSR
43
NT AUTHORITY\IUSR
False
at System.Web.Configuration.M achineKeyS ection.Enc ryptOrDecr yptData(Bo olean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType, Boolean signData) at System.Web.UI.Page.Decrypt String(Str ing s, Purpose purpose) at System.Web.Handlers.Assemb lyResource Loader.Sys tem.Web.IH ttpHandler .ProcessRe quest(Http Context context)
There is this, but it just doesn't seem to have anything to do with deleting a file:
+ System
- Provider
[ Name] ASP.NET 4.0.30319.0
- EventID 1309
[ Qualifiers] 32768
Level 3
Task 3
Keywords 0x80000000000000
- TimeCreated
[ SystemTime] 2013-08-15T20:41:29.000000
EventRecordID 12744336
Channel Application
Computer xxx
Security
- EventData
3012
An error occurred processing a web or script resource request. The resource identifier failed to decrypt.
8/15/2013 3:41:29 PM
8/15/2013 8:41:29 PM
887f8d1bb39e4bdbb4c178b484
80005
834
0
/LM/W3SVC/2/ROOT-1-1302102
Full
/
C:\inetpub\ftproot\xxx\
xxx
1320
w3wp.exe
NT AUTHORITY\SYSTEM
HttpException
Unable to validate data. at System.Web.Configuration.M
http://xxx.com/WebResource.axd?d=6ol4SXiyVX-Ti1WL3-8x3yud-XxlNVpc9WYXuSCtsFE844m5tyywqkMN8r-28s3tCRqAGRrM0LEmyFRuWuubl-FlH3feU8SxMi2tgD1Fhjgo99EXNd5qjYODHfJTDEVfe8wkee2QtApI2APrPbs04mNrj2MGUP6Vad167y9ye616evP65cu2Yl4HAPHULDunJ_WPYO6vYce85NXxEc65Fg2&t=635060488569420000
/WebResource.axd
108.34.100.142
False
NT AUTHORITY\IUSR
43
NT AUTHORITY\IUSR
False
at System.Web.Configuration.M
ASKER
Help?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The identity for this website is LocalSystem.
I tried adding:
IIS AppPool/LocalSystem and that wasn't an option.
So I did add:
IIS AppPool/DefaultAppPool and granted all permissions.
But it still fails.
Did I do that right?
I tried adding:
IIS AppPool/LocalSystem and that wasn't an option.
So I did add:
IIS AppPool/DefaultAppPool and granted all permissions.
But it still fails.
Did I do that right?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
there is no built-in account to add for "DefaultAppPool" to select it.
ASKER
This s still a problem. Maybe someday someone somewhere will somehow have an answer. :)
ASKER
As I said, I am setting the "User" role with the required permissions.
I don't know what the ApplicationPoolIdentity points to.
Anonymous authentication is IUSR in IIS7, but when I go to set permissions, IUSR is not one of the users in the list.