Why can't I create a directory by asp.net ?

liunx

Guest
Hello,
I use asp.net to create a directory. But the following error occured. I add everyone full access to that directory. But it still didn't work. What's the problem ?


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the path "test" is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.Robert Chu,

Go into IIS and find the file that you use to create this directory. Then right click/properties/File Security/Edit button (located under the first section "Anonymouse access and authentication control")

The page should be running under a IUSER_? name and Anonymouse access and integrated windows authentication are probably checked.

What you need to do is give either make sure that IUSER_? has the correct permissoins for the folder or change the name to a user who has access to do the following actions.I'm using windows 2003. I can't find the permissions check box for the folder.I can't find the permissions check box for the folder???
Where are you looking.

You need to do this through IIS not windows explorer.
Find the asp.net .aspx page that creates the directory (in IIS),
Right Click it, select properties.
Click the File Security Tab located at the top.
Then under the section ""Anonymouse access and authentication control", click the edit button.

Now you should see the checkboxs for anonymouse access, integrated security.

From here either make the page execute under a different user name that has the permissions needed to create a file.I see anonymouse access, integrated security and set everyone uses anonymous access. But it still doesn't work. How can I make the page execute under a different user name that has the permissions needed to create a file ?what is iis?change the IUSER name. Lets say you have admin writes. Then if you change IUSER_? with say
RobertC as the user name and then your password, now the page will execute under your name with your permissionshedlikeahole,
IIS Internet Information Services - It is what web pages are served up on, on a windows environment. Asp, asp.net pages use IIS.robert chu..

the user, (localhost)/aspnet must have write access to the location you are trying to create th folder.

if let say you are creating the folder "newFOlder" in C:\temp\, then aspnet user must have access in the "temp" folder.

in windows explorer, right click on folder to the properties, and add the user, aspnet to the permission box....remember to give write access to it..

-TakI add my username in iis to the file "test.aspx". Then I change the security tab on wwwroot to full control. But I found the general tab still shows Read-Only although I try to uncheck it. Then, I test the page, it still shows the following error.

System.UnauthorizedAccessException: Access Denied "test"。Rober Chu,
I got this working at home the other night but im not sure which user i gave permission to. In thinking im not sure that i changed the name the page executed under (in asp i did change the name that the page executed under) but i think with asp.net i either gave the ASP.NET or IUSER access to the directory that i wanted to be able to write in.

Ill check tonight and get back with you.
 
Back
Top