473,624 Members | 2,561 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Could not find a part of the path

Hi,

I know query in Subject line "Could not find a part of the path" has
been replied before lots of time, but mine is bit different.

My web server is windows 2003 R2 with both .net framework 1.1 and 2.0
installed on C:\.
Websites are saved on D:\wwwroot
I run the follow code for a website which is running on dedicated pool,
aspx files on 1.1 framework:

If Not directory.Exist s(Server.mappat h("..\Images\ " & i)) then
directory.creat e(Server.mappat h("..\Images\ " & i))
end if

When i try to create a sub-folder 22 under D:\wwwroot\<web site>\Images\
i get following error:

Could not find a part of the path "D:\"

If i manually create folder 22, then the code works fine to upload
images into that folder.

I googled a lot and tried everything... gave aspnet account full
permissions to D:, tried
http://support.microsoft.com/default...b;en-us;827421
also set up asp.net service to run using Network Service, restarted
server.. but all in vain

Then i changed the website properties -ASP.NET tab -ASP.NET version
from 1.1 to 2.0

And this did the trick and code started working fine.
But i have around 70 websites on this server using .net 1.1, and also I
DONT want to use this approach coz I am sure there must be a workaround
to use both 1.1 and 2.0 on same IIS and running websites properly

Please help!!

Thanx in advance

Warm Regards

PS: I got error in event log that permission denied to
\\<servername>\ D$\System Volume Information
when i was running servermapdrive service mentioned in
http://support.microsoft.com/default...b;en-us;827421

Aug 31 '06 #1
3 11325
2003, by design, does not allow path traversal, which means your ASP.NET
code is stuck in its tree. You are attempting to traverse back to root of
the drive and create a folder. You can turn of this security feature in IIS,
if you wish to. I believe there is also a code access security setting in
the machine.config that restricts you.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** ****
Think outside of the box!
*************** *************** *************** ****
<go***@rediffma il.comwrote in message
news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
Hi,

I know query in Subject line "Could not find a part of the path" has
been replied before lots of time, but mine is bit different.

My web server is windows 2003 R2 with both .net framework 1.1 and 2.0
installed on C:\.
Websites are saved on D:\wwwroot
I run the follow code for a website which is running on dedicated pool,
aspx files on 1.1 framework:

If Not directory.Exist s(Server.mappat h("..\Images\ " & i)) then
directory.creat e(Server.mappat h("..\Images\ " & i))
end if

When i try to create a sub-folder 22 under D:\wwwroot\<web site>\Images\
i get following error:

Could not find a part of the path "D:\"

If i manually create folder 22, then the code works fine to upload
images into that folder.

I googled a lot and tried everything... gave aspnet account full
permissions to D:, tried
http://support.microsoft.com/default...b;en-us;827421
also set up asp.net service to run using Network Service, restarted
server.. but all in vain

Then i changed the website properties -ASP.NET tab -ASP.NET version
from 1.1 to 2.0

And this did the trick and code started working fine.
But i have around 70 websites on this server using .net 1.1, and also I
DONT want to use this approach coz I am sure there must be a workaround
to use both 1.1 and 2.0 on same IIS and running websites properly

Please help!!

Thanx in advance

Warm Regards

PS: I got error in event log that permission denied to
\\<servername>\ D$\System Volume Information
when i was running servermapdrive service mentioned in
http://support.microsoft.com/default...b;en-us;827421

Aug 31 '06 #2
Cheers for the reply.

But how come it works with ASP 2.0 on the same IIS?

And can you please tell me how to
1) "You can turn of this security feature in IIS, if you wish to"
2) "I believe there is also a code access security setting in the
machine.config that restricts you"

Thanks

Cowboy (Gregory A. Beamer) wrote:
2003, by design, does not allow path traversal, which means your ASP.NET
code is stuck in its tree. You are attempting to traverse back to root of
the drive and create a folder. You can turn of this security feature in IIS,
if you wish to. I believe there is also a code access security setting in
the machine.config that restricts you.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Aug 31 '06 #3
Ok, i got the solution.

First of all i have Ensim on this server which creates application
pools that run with user credentials (and users are member of
WVH_ANON_USERS_ GROUP)

And when i looked on permission settings on D:, this group had special
permission that denies any sort of access on D:

I gave Read Permissions for D: "This folder only" to
WVH_ANON_USERS_ GROUP and it started working.

So bottom line is, that when u get such problem, you should first check
which Application Pool you have defined for the website in IIS. Then in
IIS, right click on that application pool -properties -Identity
If the second radio button is selected, check the username specified
and make sure that user has got read permissions to D: or the root
drive you want to access

HTH
go***@rediffmai l.com wrote:
Cheers for the reply.

But how come it works with ASP 2.0 on the same IIS?

And can you please tell me how to
1) "You can turn of this security feature in IIS, if you wish to"
2) "I believe there is also a code access security setting in the
machine.config that restricts you"

Thanks

Cowboy (Gregory A. Beamer) wrote:
2003, by design, does not allow path traversal, which means your ASP.NET
code is stuck in its tree. You are attempting to traverse back to root of
the drive and create a folder. You can turn of this security feature in IIS,
if you wish to. I believe there is also a code access security setting in
the machine.config that restricts you.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Aug 31 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
53453
by: Matthias Ludwig | last post by:
I'm trying to create a directory on the web server with a vb.net code: .... Dim dirName As String = "w:\filepath\images" If Not Directory.Exists(dirName) Then Directory.CreateDirectory(dirName) Label1.Text = "Directory created" Else
1
4496
by: Alex | last post by:
Hello, in my company, we have a diagnostic tool for hardware. Depending on the hardware projcet, a different project configuration is needed. The configuration file is written in XML and contains information for the visualization and storage of the retrieved data. From mid july till now, i have made 4 different configuration sets and everything was fine. Today, i got the order to make a new configuration set. When the xml file was...
5
7215
by: Tom Vogel | last post by:
Creating a subfolder within my ASP.NET application folder fails with the above error, but only at my hosting provider. The command: Directory.CreateDirectory(path) Path is set to 'D:\appfolder\test2'. ASPNET has full control on the application folder. Any ideas why this fails? - Tom
0
1139
by: jessica | last post by:
Hi, I got a problem "Could not find a part of the path". On my loca machine I mapped the V:\LoggerNet to a remote server folder where th real-time data come in. I checked the file, it gets updated with th original server source. The code is like streamreader sr=null; sr = File.OpenText("V:\\LoggerNet\\newdata.dat"); text = sr.ReadToEnd(); But when I run the code, it gave error "Could not find a part of th
0
1664
by: haylow | last post by:
Hi I am new to ASP.NET and am working on an application that runs on a webserver. The user will open up the web interface in a browser on their local machine and enter a path to a directory. I have 2 problems: First, I can't find a control that will let the user browse the file system and specify a directory - the only one I can find is the one that lets the user specify a file.
1
2231
by: Steve | last post by:
Hi all, I am referring to this article in MSDN : http://msdn.microsoft.com/library/en-us/secauthn/security/logonuser.asp While creating folder on the remote machine, we are specifying the UNC path as per the example. But we get this error "could not find a part of the path". we are prefixing the path with @ symbol and also tried with the escaping the "\\".
9
13710
by: Clinton Frankland | last post by:
Hi, On a Windows 2000 Server when attempting to use System.IO.Directory.CreateDirectory(string.concat(Server.MapPath(""), "\verify")) I receive a System.IO.DirectoryNotFoundException error: Could not find a part of the path "D:\". The full path is "D:\hshome\clinton\test.gotchasoft.com\verify" The web is running using impersonation as a user on the local machine.
14
9366
by: Gianfranco | last post by:
Hi everybody, First of all, sorry for my english if it isn't perfect ;-p I have an error in an asp.net application. I have win2003 server, with iis 6. I'm developping with visual studio 2005, vb.net, framework 2 I'm trying to access some binary files stored in C: in server2003. if i
2
5152
by: Guoqi Zheng | last post by:
Dear sir, I am trying to save a binary data by below script, however,it always give me an error of "Could not find a part of the path "C:\temp\". " Any idea what I did wrong here? Public Sub SaveAs(ByVal strPath As String)
0
8231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8168
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
7153
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6107
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4075
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2603
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.