![]() |
|
|
|||||||
![]() |
ASP Net - Access to the path .... is denied |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Hi there,
There was older thead i created for that question a week ago, but then I had some sort of vacations, and couldn't participate. Basically I am getting Access to the path "Path name" is denied when I execute the following code on my production server (W2003) Dim myFolder As String = Server.MapPath("..\..\..\sDirectory\") Dim FileName As String For Each FileName In Directory.GetFiles(myFolder , "*.doc") Response.Write(FileName) Exit For Next This code will run just fine on my testing machine (Windows XP) sDirectory is a virtual directory. Anonymous is turned off. DIgest authentication for Windows domain servers is selected. Basic authentication is selected. ..Net Password authentication is not selected. Permissions on the file: Administrator (Domain\Administrator) aspnet_wp account (computerName\ASPNET) Authenticated Users Everyone I don't use identity impersonate in my web.config. I found many discussions regarding that problem, unfortunatelly still cannot resolve it by myself... j_stus@hotmail.com |
|
|
|
|
#2 |
|
Posts: n/a
|
I know this sounds hokey, but have you looked at the populated myFolder
string variable to see what the translated path actually is, and whether it is valid? You could do a Trace write of this and turn on page tracing temporarily to see it. Otherwise, the identity your app runs under (whether the ASPNET account IUSR or however else it's configured) needs to have the required permissions on this folder on the target machine. Peter -- Co-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com UnBlog: http://petesbloggerama.blogspot.com "" wrote: > Hi there, > > There was older thead i created for that question a week ago, but then > I had some sort of vacations, and couldn't participate. > Basically I am getting Access to the path "Path name" is denied when I > execute the following code on my production server (W2003) > > Dim myFolder As String = Server.MapPath("..\..\..\sDirectory\") > Dim FileName As String > > For Each FileName In Directory.GetFiles(myFolder , "*.doc") > Response.Write(FileName) > Exit For > Next > > This code will run just fine on my testing machine (Windows XP) > > sDirectory is a virtual directory. > Anonymous is turned off. > DIgest authentication for Windows domain servers is selected. > Basic authentication is selected. > ..Net Password authentication is not selected. > Permissions on the file: > Administrator (Domain\Administrator) > aspnet_wp account (computerName\ASPNET) > Authenticated Users > Everyone > I don't use identity impersonate in my web.config. > > > I found many discussions regarding that problem, unfortunatelly still > cannot resolve it by myself... > > =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?= |
|
|
|
#3 |
|
Posts: n/a
|
re:
> Dim myFolder As String = Server.MapPath("..\..\..\sDirectory\") > sDirectory is a virtual directory. Do you have AspEnableParentPaths set to true ? To increase security, parent paths are disabled by default. http://msdn.microsoft.com/library/de...1ed541e3a5.asp Juan T. Llibre, asp.net MVP aspnetfaq.com : http://www.aspnetfaq.com/ asp.net faq : http://asp.net.do/faq/ foros de asp.net, en español : http://asp.net.do/foros/ =================================== <> wrote in message news: ps.com... > Hi there, > > There was older thead i created for that question a week ago, but then > I had some sort of vacations, and couldn't participate. > Basically I am getting Access to the path "Path name" is denied when I > execute the following code on my production server (W2003) > > Dim myFolder As String = Server.MapPath("..\..\..\sDirectory\") > Dim FileName As String > > For Each FileName In Directory.GetFiles(myFolder , "*.doc") > Response.Write(FileName) > Exit For > Next > > This code will run just fine on my testing machine (Windows XP) > > sDirectory is a virtual directory. > Anonymous is turned off. > DIgest authentication for Windows domain servers is selected. > Basic authentication is selected. > .Net Password authentication is not selected. > Permissions on the file: > Administrator (Domain\Administrator) > aspnet_wp account (computerName\ASPNET) > Authenticated Users > Everyone > I don't use identity impersonate in my web.config. > > > I found many discussions regarding that problem, unfortunatelly still > cannot resolve it by myself... > Juan T. Llibre |
|
|
|
#4 |
|
Posts: n/a
|
I actually print myFolder path, then copy and paste to explorer and can
access it... AspEnableParentPaths was not set to true, I did that but it didn't fix my problem. My xp machine has this option disabled and still works... j_stus@hotmail.com |
|
|
|
#5 |
|
Posts: n/a
|
I did one more test.
I created another virtual directory, that points to some folder on my server (local) Then used same code to access it and it worked. Then I checked permissions on both folders under security tab, and they seem to be similar. The only difference is local one has localMachineName/ASPNET and network has anotherMachineName/ASPNET. j_stus@hotmail.com |
|
|
|
#6 |
|
Posts: n/a
|
Please save the following code as "identity.aspx", and run it in the same directory
as the file which is giving you the "access denied..." error message : identity.aspx ------------- <%@ Page Language="VB" %> <%@ Import NameSpace = System.Security.Principal %> <script runat="server"> Sub Page_Load() Dim tmp As String = WindowsIdentity.GetCurrent.Name() Label1.Text = tmp End Sub </script> <html> <head> <title>WindowsIdentity.GetCurrent.Name()</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label> </div> </form> </body> </html> ---------- When you run the file, make note of the account returned as the asp.net identity. Then, give read/write/change permissions to *that* account for the "myFolder" directory. Let us know what happens when you do that. Juan T. Llibre, asp.net MVP aspnetfaq.com : http://www.aspnetfaq.com/ asp.net faq : http://asp.net.do/faq/ foros de asp.net, en español : http://asp.net.do/foros/ =================================== <> wrote in message news: oups.com... >I actually print myFolder path, then copy and paste to explorer and can > access it... > AspEnableParentPaths was not set to true, I did that but it didn't fix > my problem. > My xp machine has this option disabled and still works... > Juan T. Llibre |
|
|
|
#7 |
|
Posts: n/a
|
WindowsIdentity.GetCurrent().Name will print NT AUTHORITY\NETWORK
SERVICE User.Identity.Name will print myDomain/myUserName. So I added read/write/change permissions to myDomain/myUserName - didn't help. Now, I don't have user called NT AUTHORITY\NETWORK SERVICE on my domain, nor on the box that has the folder. Should I create one? On domain? j_stus@hotmail.com |
|
|
|
#8 |
|
Posts: n/a
|
I beleive that NETWORK SERVICE account is created automatically if you are
on Win 2k3 SA <> wrote in message news: ups.com... > WindowsIdentity.GetCurrent().Name will print NT AUTHORITY\NETWORK > SERVICE > User.Identity.Name will print myDomain/myUserName. > > So I added read/write/change permissions to myDomain/myUserName - > didn't help. > Now, I don't have user called NT AUTHORITY\NETWORK SERVICE on my > domain, nor on the box that has the folder. Should I create one? On > domain? > MSDN |
|
|
|
#9 |
|
Posts: n/a
|
re:
> Now, I don't have user called NT AUTHORITY\NETWORK SERVICE > on my domain, nor on the box that has the folder. Should I create one? NT AUTHORITY\NETWORK SERVICE is a local account, not a domain account. Are you running your ASP.NET web server on a domain server ? Juan T. Llibre, asp.net MVP aspnetfaq.com : http://www.aspnetfaq.com/ asp.net faq : http://asp.net.do/faq/ foros de asp.net, en español : http://asp.net.do/foros/ =================================== <> wrote in message news: ups.com... > WindowsIdentity.GetCurrent().Name will print NT AUTHORITY\NETWORK > SERVICE > User.Identity.Name will print myDomain/myUserName. > > So I added read/write/change permissions to myDomain/myUserName - > didn't help. > Now, I don't have user called NT AUTHORITY\NETWORK SERVICE on my > domain, nor on the box that has the folder. Should I create one? On > domain? > Juan T. Llibre |
|
|
|
#10 |
|
Posts: n/a
|
I guess I was not clear enough.
ASP.NET is running on Windows2003 server. It's not domain controller. I created virtual directory on that machine that points to network directory. It points to another computer on the network (W2000 server). Because W2000 doesn't have NT AUTHORITY\NETWORK SERVICE I am not sure how to resolve it... j_stus@hotmail.com |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| server 2003 access denied errors | lockeff6 | General Help Related Topics | 0 | 07-15-2009 03:12 PM |
| Access to the path ... is denied | calvinkwoo3000 | General Help Related Topics | 1 | 11-05-2008 11:04 PM |
| Access Denied error while calling Windows service in web application | megha | Software | 0 | 04-05-2008 10:03 AM |
| I cant access the MCP site | T3M4N | MCTS | 1 | 03-18-2008 06:21 PM |
| access denied | techboi | General Help Related Topics | 2 | 08-24-2007 12:56 AM |