473,799 Members | 3,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem creating directories through asp.net

When a user registers with my site, I create a separate folder for them
(for uploading photos, etc).

The code for this has been working fine for 1 year, but over the past 2
weeks it has been falling down on the 'CreateDirector y' function.

The error I'm getting is:

"Could not find a part of the path "E:\"."
Here's the code where the site falls down:

Directory.Creat eDirectory(Serv er.MapPath("mem bers\" & sUserName.ToLow er))
My host provider has no idea why it is happening.. what could be the
reason?

Thanks,
Peter
--

fiddlewidawiddu m
Mar 8 '06 #1
4 1468
Peter,

Must be they changed something in security. Now you are in trouble of
finding what do you have change to accomodate their change.

Eliyahu

"Stimp" <re*@spumco.com > wrote in message
news:sl******** ********@carbon .redbrick.dcu.i e...
When a user registers with my site, I create a separate folder for them
(for uploading photos, etc).

The code for this has been working fine for 1 year, but over the past 2
weeks it has been falling down on the 'CreateDirector y' function.

The error I'm getting is:

"Could not find a part of the path "E:\"."
Here's the code where the site falls down:

Directory.Creat eDirectory(Serv er.MapPath("mem bers\" & sUserName.ToLow er))
My host provider has no idea why it is happening.. what could be the
reason?

Thanks,
Peter
--

fiddlewidawiddu m

Mar 8 '06 #2
> When a user registers with my site, I create a separate folder for them
(for uploading photos, etc).

The code for this has been working fine for 1 year, but over the past 2
weeks it has been falling down on the 'CreateDirector y' function.

The error I'm getting is:

"Could not find a part of the path "E:\"."
Here's the code where the site falls down:

Directory.Creat eDirectory(Serv er.MapPath("mem bers\" & sUserName.ToLow er))
My host provider has no idea why it is happening.. what could be the
reason?

Thanks,
Peter


By default the account that ASP.Net uses has no rights to create
directories or write to the filesystem. Apparently the access rights
that did grant you "create directory" rights have changed.
Did your provider change the default ASPNET user?
Did your provider move your site to a different physical directory?
What happened two weeks ago?

Hans Kesting
Mar 8 '06 #3
On Wed, 8 Mar 2006 Hans Kesting <ne***********@ spamgourmet.com > wrote:
When a user registers with my site, I create a separate folder for them
(for uploading photos, etc).

The code for this has been working fine for 1 year, but over the past 2
weeks it has been falling down on the 'CreateDirector y' function.

The error I'm getting is:

"Could not find a part of the path "E:\"."
Here's the code where the site falls down:

Directory.Creat eDirectory(Serv er.MapPath("mem bers\" & sUserName.ToLow er))
My host provider has no idea why it is happening.. what could be the
reason?

Thanks,
Peter


By default the account that ASP.Net uses has no rights to create
directories or write to the filesystem. Apparently the access rights
that did grant you "create directory" rights have changed.
Did your provider change the default ASPNET user?
Did your provider move your site to a different physical directory?
What happened two weeks ago?


I just rang my hosting provider there and they told me that they have
upgraded the security on their servers for ASP.NET accounts so that I
can no longer create a folder from the server root directory (i.e. E:\).

Instead, he suggests, I'll need to create a directory from the
Application root.

This means that:
Directory.Creat eDirectory(Serv er.MapPath("mem bers\blah"))

is not allowed with the Server.MapPath part...

but I'll need to use something else instead like:

Directory.Creat eDirectory("mem bers\" & sDirName)

But of course, this doesn't work.

Any suggestions on an alternative CreateDirectory structure?

Thanks,
Peter
--

fiddlewidawiddu m
Mar 8 '06 #4
On Wed, 8 Mar 2006 Stimp <re*@spumco.com > wrote:

Any suggestions on an alternative CreateDirectory structure?

For those who are interested, I found the solution to this issue:

http://www.codeproject.com/csharp/cr...torymethod.asp

Works like a charm. :)

--

fiddlewidawiddu m
Mar 8 '06 #5

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

Similar topics

3
2015
by: dave | last post by:
I am using vs.net 2003 on windows xp. After clicking on a project within my solution and selecting create new folder vs.net responds back with , the "directory already exists". If i look at the virtual directory on my pc the directory does not exist. If i create the folder from explorer then select hide/show files within vs.net I see the directory I just created. When I include that directory in my project by right clicking and selecting...
6
3671
by: Eran Kampf | last post by:
I am trying to dynamically create directories in my ASP.NET application (I am using Server.MapPath("/")+"test" as the folder) and I am getting a DirectoryNotFoundException saying "Could not find a part of the path "D:\". My site is hosted on a public ISP that for obvious security reasons does not allow my read access above my wwwroot folder which seems to be a problem when trying to create directories... Is there any way to solve this?
3
293
by: dave | last post by:
I am using vs.net 2003 on windows xp. After clicking on a project within my solution and selecting create new folder vs.net responds back with , the "directory already exists". If i look at the virtual directory on my pc the directory does not exist. If i create the folder from explorer then select hide/show files within vs.net I see the directory I just created. When I include that directory in my project by right clicking and selecting...
3
1978
by: Paras Sharma | last post by:
Hi all, We are facing this big problem. Scenario is as follows. We have one single solution (say EIS) under which there are 25 projects. All the files are saved at a central location under Visual Sorce Safe on a seprate machine. For a new person who is trying to setup this solution file on his / her local machine follows the following step. 1. "Set working folder" for the EIS folder from VSS on to his local machine
7
2921
by: beadman | last post by:
Hello I am trying to use autonumber on an invoice with the prexif "CRW", so the Invoice ID will be CRW00001, CRW00002..and so on. I have put a Format of "CRW"00000 in the table design for the field Invoice ID and the tables are succesfully creating the Invoice ID with the "CRW" prefix in an incremental Order..I have created an form and i want the user to be able to use the field Invoice ID (e.g. CRW00001) to search for records of customers...
0
9687
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
9541
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
10251
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9072
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...
0
6805
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
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
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
2
3759
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.