Hi
I have an application using asp.net that I am running on my PC.
The web form has a text box where you can enter a name for a new Photo
category then click on the button.
The code is intended to create a new directory under Photos such as
"Relatives".
However, I am getting the following error message in IE (between the two
rows of @@@@:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Server Error in '/Photos' Application.
________________________________________
Access to the path "c:\inetpub\wwwroot\Photos\Relatives" is denied.
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
"c:\inetpub\wwwroot\Photos\Relatives" 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.
Source Error:
Line 38: strAppRoot = Server.MapPath("/Photos")
Line 39: strNewFolder = strAppRoot & "\" & strName
Line 40: Directory.CreateDirectory(strNewFolder)
Line 41: End Sub
Line 42:
Source File: c:\inetpub\wwwroot\photos\category.aspx Line: 40
Stack Trace:
[UnauthorizedAccessException: Access to the path
"c:\inetpub\wwwroot\Photos\Relatives" is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +393
System.IO.Directory.InternalCreateDirectory(String fullPath, String path)
+632
System.IO.Directory.CreateDirectory(String path) +195
ASP.category_aspx.CreateNewCategory(String strName) in
c:\inetpub\wwwroot\photos\category.aspx:40
ASP.category_aspx.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\photos\category.aspx:45
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
________________________________________
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
I have tried the tips in the above message, but to no avail. It is true to
say that I do not have a clear understanding of the part of the msg that says:
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.
So, if somebody could give me a hand I would appreciate it.
--
Kind regards
Ross Petersen 2 2118
Hi Ross,
I'm not sure what you don't understand, so forgive me if I tell you anything
you already know.
Every application running on an Operating System is called a process. If you
look in Task Manager, you can see all the processes running on your machine.
If you've never looked before, it can be quite enlightening to find out how
many processes are running on your machine when you have no programs running
at all. That is because services are processes too. They just run in the
background.
Every process that runs on your machine runs under the context of a User
account on your machine or domain. The User account determines what rights
that process has to access resources, such as the file sytem, on your
machine or domain. That should make clear the part of the message which
reads: 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
In case it is NOT clear to you now, I'll explain. The "process identity" is
the User account under which ASP.Net runs. Typically, it is a machine
identity or account, with the name "ASPNET" (on IIS) or "Network Service" on
IIS 6. It can be any account you specify in the machine.config file of the
machine.
By default, that User account has very limited permissions, as a security
measure. You can grant that user any permissions it needs if you are an
Administrator on your machine or domain.
In this case, the missing permission is:
[UnauthorizedAccessException: Access to the path "c:\inetpub\wwwroot\Photos\Relatives" is denied.]
IOW, your ASP.Net process identity doesn't have permission to create a
directory under that path.
Solution: Grant the ASP.Net process identity (User account) the permission
it needs to create the folder.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
ASP.Net is a process which runs on your machine as well.
"Ross" <Ro**@discussions.microsoft.com> wrote in message
news:AF**********************************@microsof t.com... Hi
I have an application using asp.net that I am running on my PC.
The web form has a text box where you can enter a name for a new Photo category then click on the button.
The code is intended to create a new directory under Photos such as "Relatives".
However, I am getting the following error message in IE (between the two rows of @@@@:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Server Error in '/Photos' Application. ________________________________________ Access to the path "c:\inetpub\wwwroot\Photos\Relatives" is denied. 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 "c:\inetpub\wwwroot\Photos\Relatives" 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.
Source Error:
Line 38: strAppRoot = Server.MapPath("/Photos") Line 39: strNewFolder = strAppRoot & "\" & strName Line 40: Directory.CreateDirectory(strNewFolder) Line 41: End Sub Line 42:
Source File: c:\inetpub\wwwroot\photos\category.aspx Line: 40
Stack Trace:
[UnauthorizedAccessException: Access to the path "c:\inetpub\wwwroot\Photos\Relatives" is denied.] System.IO.__Error.WinIOError(Int32 errorCode, String str) +393 System.IO.Directory.InternalCreateDirectory(String fullPath, String
path) +632 System.IO.Directory.CreateDirectory(String path) +195 ASP.category_aspx.CreateNewCategory(String strName) in c:\inetpub\wwwroot\photos\category.aspx:40 ASP.category_aspx.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\photos\category.aspx:45 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Page.ProcessRequestMain() +750
________________________________________ Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
ASP.NET Version:1.1.4322.2032
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
I have tried the tips in the above message, but to no avail. It is true
to say that I do not have a clear understanding of the part of the msg that
says: 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.
So, if somebody could give me a hand I would appreciate it.
-- Kind regards
Ross Petersen
Hi Kevin
Thanks very muchly - I shall give it a try - thanks for the really
good/clear explanation I really appreciate it.
You're bloods worth bottling.
Kind regards
Ross
"Kevin Spencer" wrote: Hi Ross,
I'm not sure what you don't understand, so forgive me if I tell you anything you already know.
Every application running on an Operating System is called a process. If you look in Task Manager, you can see all the processes running on your machine. If you've never looked before, it can be quite enlightening to find out how many processes are running on your machine when you have no programs running at all. That is because services are processes too. They just run in the background.
Every process that runs on your machine runs under the context of a User account on your machine or domain. The User account determines what rights that process has to access resources, such as the file sytem, on your machine or domain. That should make clear the part of the message which reads:
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
In case it is NOT clear to you now, I'll explain. The "process identity" is the User account under which ASP.Net runs. Typically, it is a machine identity or account, with the name "ASPNET" (on IIS) or "Network Service" on IIS 6. It can be any account you specify in the machine.config file of the machine.
By default, that User account has very limited permissions, as a security measure. You can grant that user any permissions it needs if you are an Administrator on your machine or domain.
In this case, the missing permission is:
[UnauthorizedAccessException: Access to the path "c:\inetpub\wwwroot\Photos\Relatives" is denied.]
IOW, your ASP.Net process identity doesn't have permission to create a directory under that path.
Solution: Grant the ASP.Net process identity (User account) the permission it needs to create the folder.
-- HTH, Kevin Spencer ..Net Developer Microsoft MVP I get paid good money to solve puzzles for a living
ASP.Net is a process which runs on your machine as well. "Ross" <Ro**@discussions.microsoft.com> wrote in message news:AF**********************************@microsof t.com... Hi
I have an application using asp.net that I am running on my PC.
The web form has a text box where you can enter a name for a new Photo category then click on the button.
The code is intended to create a new directory under Photos such as "Relatives".
However, I am getting the following error message in IE (between the two rows of @@@@:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Server Error in '/Photos' Application. ________________________________________ Access to the path "c:\inetpub\wwwroot\Photos\Relatives" is denied. 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 "c:\inetpub\wwwroot\Photos\Relatives" 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.
Source Error:
Line 38: strAppRoot = Server.MapPath("/Photos") Line 39: strNewFolder = strAppRoot & "\" & strName Line 40: Directory.CreateDirectory(strNewFolder) Line 41: End Sub Line 42:
Source File: c:\inetpub\wwwroot\photos\category.aspx Line: 40
Stack Trace:
[UnauthorizedAccessException: Access to the path "c:\inetpub\wwwroot\Photos\Relatives" is denied.] System.IO.__Error.WinIOError(Int32 errorCode, String str) +393 System.IO.Directory.InternalCreateDirectory(String fullPath, String path) +632 System.IO.Directory.CreateDirectory(String path) +195 ASP.category_aspx.CreateNewCategory(String strName) in c:\inetpub\wwwroot\photos\category.aspx:40 ASP.category_aspx.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\photos\category.aspx:45 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Page.ProcessRequestMain() +750
________________________________________ Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
I have tried the tips in the above message, but to no avail. It is true to say that I do not have a clear understanding of the part of the msg that says: 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.
So, if somebody could give me a hand I would appreciate it.
-- Kind regards
Ross Petersen This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Russ |
last post by:
I'm interested in setting up a web page where live data can be
displayed in real-time on the web page.
For example: I would like to display a (nice looking) graph of some
data value versus time...
|
by: davidgordon |
last post by:
Hi,
This seems impossible to me. I've read tons of posts, but I just cannot
fathom it out.
I have a form for our range of products.
There are four fields (text) which need to be filled with an...
|
by: ScottM |
last post by:
I have run into a problem generating the class file via the WSDL utility. I
have a WSDL file that was generated by XMLSpy and is able to be read by the
Java code utility, but I get the following...
|
by: Frankie |
last post by:
Hello:
I'm coding a website which allows the owner to make add/change/deletes to
his product database, which includes product images stored separately on the
server. I have coded the Delete page...
|
by: bizt |
last post by:
Hi,
I am trying to carry out an upload and save file in directory operation
using move_uploaded_file(). However, when I run the script it give me
the following error:
Warning:...
|
by: Shaqman |
last post by:
I have a server side asp button that submits a form after completion and a
postback to acknowledgement. I need to disable the button after the user
clicks on this once to prevent duplication. There...
|
by: MMAS |
last post by:
I've got my .net application set up to use gmail as a mail server (see
code below). Everything works quite well, actually, EXCEPT for one
particular email account. I've created an "admin" account...
|
by: lorirobn |
last post by:
Hi,
I need to add photos to my database. Back End is on MS SQL Server (I
believe 2000), and Front End is on MS Access.
I have read about storing the photos as BLOBS, but I am not sure how
to...
|
by: Kevin Liebowicz |
last post by:
Yes, I wasted the past two days trying to fix this.
Yes, this is on a Win2003 Server.
Yes, this machine is a domain controller.
Yes, I seen the dozens of KB articles like this one:...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
|
by: Oralloy |
last post by:
Hello Folks,
I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA.
My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
|
by: Johno34 |
last post by:
I have this click event on my form. It speaks to a Datasheet Subform
Private Sub Command260_Click()
Dim r As DAO.Recordset
Set r = Form_frmABCD.Form.RecordsetClone
r.MoveFirst
Do
If...
|
by: ezappsrUS |
last post by:
Hi,
I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
|
by: F22F35 |
last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...
| |