Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Directory creation

Reply
Thread Tools

Directory creation

 
 
Sparky
Guest
Posts: n/a
 
      07-22-2003
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


 
Reply With Quote
 
 
 
 
Steve C. Orr, MCSD
Guest
Posts: n/a
 
      07-22-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() are not returning the specified directory Nathan Sokalski ASP .Net 2 09-06-2007 03:58 PM
How to (batch) set EXIF date taken and IPTC creation date and creation time for photos with filenames YYMMDDHHMMSS#.jpg? guercheLE@gmail.com Digital Photography 1 10-04-2005 07:15 PM
Zip file directory creation problem Mark F Java 7 07-28-2004 05:33 PM
mfc / c++ directory creation problem Rohan De Sa C Programming 2 09-23-2003 09:17 PM
Newbie - Directory/File Creation Michael J Whitmore Python 1 07-08-2003 08:39 PM



Advertisments