Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System.IO.Directory.CreateDirectory problem

Status
Not open for further replies.

GPuller

Technical User
Jun 5, 2001
7
0
0
US
Hi there!

I am working on an ASP.NET VB application and I am trying to write an uploaded file to a shared directory on another server. I want to create a directory for the file on the server first. I have been using system.io.createdirectory which works great if the shared directory is on my local machine. I am not able to this though if the shared directory is on another server. I get the messsage:

"DirectoryNotFoundException: Could not find a part of the path \\Lnntexc\DocMan_Test\..."

I have tried several approches to resolving this issue.
I tried mapping the shared directory to my maching this did not work - same error.
I tried changing the current directory to the shared directory - same error.
I tried playing with security settings - eventually giving access to the shared directory to everyone - same error.

If somebody out there has experienced this difficulty and resolved it or if someone knows the soloution please let me know. Thanks very much!
 
Yea, but I have terrible news for you. I've had this problem for years, and although I can't find it solidly documented anywhere, my experience is this:

ASP.NET pages (and ASP classic) cannot work with folders on machines other than the one that it's running on.

I have spent many many hours trying this way and that to get around this undocumented fact, and have had ppl from microsoft tell me that it will work. To which I'd post up my experience and receive nothing but dead calm and silence in reply.

Sorry, it simply can't be done.

:-(
penny1.gif
penny1.gif
 
Hey GP, I have a *possible* work around for you:

This other server, does it run win2k/xp pro and does it have IIS installed? if so, then all you'd need to do is set up an asp.net app on that server, and in your original web app, when a user wants to upload or create a folder, the page that you show them is actually from the other server.

of course, if you can't have it be a web server then this won't work, and its not as perfect as just sharing the folder and having the asp.net user account have access to it. But it may be an option if all the planets are aligned right.

D'Arcy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top