473,320 Members | 2,048 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,320 software developers and data experts.

How to create folder using URI

I'm new to .NET and C#. I need help in trying to do the following:
I need to use a URI (or something else) that allows all users of the
application to be able to access a directory and create a folder. The code
that works for some users is:
string DirLoc = "\\\\abc-prod01\\c$\Inetpub\\wwwroot\\Units\\"
Directory.CreateDirectory(DirLoc);
Users that (I assume) don't have access on this web server, get the
following message: Could not find a part of the path "\\abc-prod01\\c$".

Since that doesn't work for everyone, I thought that using a URI would work.
The one I used is:
string DirLoc = "file://abc-prod01/Units$"
Directory.CreateDirectory(DirLoc);
When using the URI, I receive the following message: URI Formats Not
Supported. So, does this mean I can't use URI's at all or that I formated the
URI incorrectly.
Please HELP!
--
DCount
Nov 16 '05 #1
2 12152
Hi,

You may have security problems with that, usually the asp.net process runs
under a restricted user that has no permission to create folders in the hdds
, the best thing to do is create a dir inside the current application ( even
so probably you will have to give permission to access ths dir to the
asp.net user )
you use Server.MapPath to make the conversion between the web app folder
names and its physical location in the hdd.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"DCount17" <DC******@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
I'm new to .NET and C#. I need help in trying to do the following:
I need to use a URI (or something else) that allows all users of the
application to be able to access a directory and create a folder. The code
that works for some users is:
string DirLoc = "\\\\abc-prod01\\c$\Inetpub\\wwwroot\\Units\\"
Directory.CreateDirectory(DirLoc);
Users that (I assume) don't have access on this web server, get the
following message: Could not find a part of the path "\\abc-prod01\\c$".

Since that doesn't work for everyone, I thought that using a URI would
work.
The one I used is:
string DirLoc = "file://abc-prod01/Units$"
Directory.CreateDirectory(DirLoc);
When using the URI, I receive the following message: URI Formats Not
Supported. So, does this mean I can't use URI's at all or that I formated
the
URI incorrectly.
Please HELP!
--
DCount

Nov 16 '05 #2
Your problem is a security issue which you are trying to bypass using
something that is not supported and would not work either if it was.
If your users don't have access to your webserver, why do you want them to
create directories on a file server?

Willy.
"DCount17" <DC******@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
I'm new to .NET and C#. I need help in trying to do the following:
I need to use a URI (or something else) that allows all users of the
application to be able to access a directory and create a folder. The code
that works for some users is:
string DirLoc = "\\\\abc-prod01\\c$\Inetpub\\wwwroot\\Units\\"
Directory.CreateDirectory(DirLoc);
Users that (I assume) don't have access on this web server, get the
following message: Could not find a part of the path "\\abc-prod01\\c$".

Since that doesn't work for everyone, I thought that using a URI would
work.
The one I used is:
string DirLoc = "file://abc-prod01/Units$"
Directory.CreateDirectory(DirLoc);
When using the URI, I receive the following message: URI Formats Not
Supported. So, does this mean I can't use URI's at all or that I formated
the
URI incorrectly.
Please HELP!
--
DCount

Nov 16 '05 #3

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

Similar topics

5
by: Eskimo Joe | last post by:
I am trying to create a desktop icon using VB6. is this possible? -p
5
by: David Webb | last post by:
The problem started when the Working Folder for a project was somehow set to the folder of another project. I set the correct working folder in VSS and deleted the .vbproj files that had been...
8
by: barb | last post by:
So that the world at large benefits from our efforts, here is one fully documented way to use Windows Irfanview freeware to create thumbnail web galleries (http://www.irfanview.com). STEP 1:...
0
by: Niyazi | last post by:
Hi, I created application that store the data in SQL SERVER that reside on network. The client also use this application to access the resources provided with application. But is the client want...
7
by: Wiebe Tijsma | last post by:
Hi, I'm using C# + webDAV to create a draft message to be sent in a user's Drafts folder. I can create the message successfully, however when I open the message in outlook, it doesn't show...
10
by: kai | last post by:
Hi, All I am trying to create a file folder for any login user, and create sub folders for the user on a web page. After the user login again, he can only sees his own folder on the Web page. I am...
4
by: Alan Mailer | last post by:
Again, I'm new to VB.net and there is something I need help with: Like (I assume) many of us, over time I want to be able to create some VB.net classes that I might want to use in more than one...
3
by: dearamitdubey | last post by:
hello All , I am using the below given code to create a folder on a click event from a button. The Folder name should be a string which i am taking it from the text box value. now my...
5
by: krasman | last post by:
hi everyone, i hope you might help me on this one. i need to create a contact in a exchange public folder using dotnet (vb or c#) and exchange 2003, without using outlook object model. i'm...
1
by: jags | last post by:
HI All I was trying to create Document librray programatically in a Sharepoint Site and is not working for me.I was trying to implement this as an Event Handler. The aim of the code is to create...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.