473,408 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Directory creation

I want to create a directory on my web server from within code. I've tried
using Request.PhysicalApplicationPath() to get the location of the
application, and appended my new directory on the end and used
Directory.CreateDirectory which fails with:

System.IO.DirectoryNotFoundException: Could not find a part of the path
"d:\". at System.IO.__Error.WinIOError(Int32 errorCode, String str) at
System.IO.Directory.InternalCreateDirectory(String fullPath, String path) at
System.IO.Directory.CreateDirectory(String path) at ...

BUT if I manually create the directory in an FTP program, and use
Directory.Exists, it manages to find the directory... the problem just
appears to be creating.

Any clues?

Cheers

Sparky
Nov 17 '05 #1
1 2400
It's probably a security issue. By default ASP.NET runs under the ASPNET
user account. This account does not have a lot of permissions on your
machine. Simply grant it full read, write & create permissions to the path
you're specifying on your server.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Sparky" <ma********@nospam.farmade.com> wrote in message
news:O0**************@tk2msftngp13.phx.gbl...
I want to create a directory on my web server from within code. I've tried
using Request.PhysicalApplicationPath() to get the location of the
application, and appended my new directory on the end and used
Directory.CreateDirectory which fails with:

System.IO.DirectoryNotFoundException: Could not find a part of the path
"d:\". at System.IO.__Error.WinIOError(Int32 errorCode, String str) at
System.IO.Directory.InternalCreateDirectory(String fullPath, String path) at System.IO.Directory.CreateDirectory(String path) at ...

BUT if I manually create the directory in an FTP program, and use
Directory.Exists, it manages to find the directory... the problem just
appears to be creating.

Any clues?

Cheers

Sparky

Nov 17 '05 #2

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

Similar topics

1
by: Tony | last post by:
I'm porting an old Coldfusion based content and asset management system to ASP.NET (and oh, how good it feels to write REAL code again - was a C++ hack for 10 years, started doing coldfusion about...
2
by: Avi Shilon | last post by:
Hi, I'm trying to create a Solution that contains several projects within it, one of which is an ASP.NET web application and the others are class libraries (Data and Business tiers, which are...
4
by: r_burgess | last post by:
TheNewUser.Invoke("SetPassword", New Object() {"123"}) Does anyone have any idea why that call wouldn't work, even though I have supplied credentials which are fully capable of setting and...
2
by: ykgoh | last post by:
Hi. I've a problem of being able to create and remove a directory but unable to write a file inside the created directory for some strange reason. I suspect that this problem could be vaguely...
6
by: Sigmathaar | last post by:
Hi, while making an XML parser for the creation of an entire directory list I got this problem and I'm having trouble solving it. The program (not yet written) goes through an XML Schema Instance...
2
by: Daniel Knöpfel | last post by:
Hello all In our project we have been using the samAccount name to authenticate users against the active directory. As the samAccountName is limited to 20 characters, we are going to use the...
0
by: Steve Moreno | last post by:
I have an ASP.NET app that writes an Excel file out to a subdirectory within the root web and then emails it out as an attachment. If I have the <identity impersonate="true"/string in the...
1
by: mrityunjay11 | last post by:
i need a vba code which reads pathname filename date of creation of all files in the given directory and it stores above attributes in a excel sheet thanks in advance
4
by: ndedhia1 | last post by:
Hi. I am writing a java program in which I want to ftp a file to another unix box. First I have to check if the directory exists in which I am ftping into and if it does not exist, I have to create...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.