473,748 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can you create a folder in ASP.net?

Hello All!

Can you dynamicly create a folder in ASP.net? Here is the set up. I have a
folder where I will store pics. What I would like to do is create a cookie,
track the user who has logged on to the site. If user deside to upload
pictures under thier profile, a subfolder under the images folder will be
created with the folder name as the users name. I would like to keep the pics
seperatred for each user.
TIA!!

Rudy
Nov 19 '05 #1
5 1262
Hi Rudy,

Yes you can *if* you have the rights to do so. ASP.NET runs under a designated account (usually ASPNET on IIS5 or NETWORK SERVICE on IIS6) and this account will need rights to be able to create a directory in that folder where you need to create it. By default the accounts used do not have this permission, so you would likely have to add it.

To see what account your app is running under you can use:

Response.Write( Environment.Use rname);

to know which account needs the permissions in question.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com/weblog
"Rudy" <Ru**@discussio ns.microsoft.co m> wrote in message news:0A******** *************** ***********@mic rosoft.com...
Hello All!

Can you dynamicly create a folder in ASP.net? Here is the set up. I have a
folder where I will store pics. What I would like to do is create a cookie,
track the user who has logged on to the site. If user deside to upload
pictures under thier profile, a subfolder under the images folder will be
created with the folder name as the users name. I would like to keep the pics
seperatred for each user.
TIA!!

Rudy

Nov 19 '05 #2
Hi Rudy,

Yes you can *if* you have the rights to do so. ASP.NET runs under a designated account (usually ASPNET on IIS5 or NETWORK SERVICE on IIS6) and this account will need rights to be able to create a directory in that folder where you need to create it. By default the accounts used do not have this permission, so you would likely have to add it.

To see what account your app is running under you can use:

Response.Write( Environment.Use rname);

to know which account needs the permissions in question.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com/weblog
"Rudy" <Ru**@discussio ns.microsoft.co m> wrote in message news:0A******** *************** ***********@mic rosoft.com...
Hello All!

Can you dynamicly create a folder in ASP.net? Here is the set up. I have a
folder where I will store pics. What I would like to do is create a cookie,
track the user who has logged on to the site. If user deside to upload
pictures under thier profile, a subfolder under the images folder will be
created with the folder name as the users name. I would like to keep the pics
seperatred for each user.
TIA!!

Rudy

Nov 19 '05 #3
Hi,

In addition to what Rick mentioned about ASP file permissions, the
actual code to create a folder would be similar to:

System.IO.Direc tory.CreateDire ctory(Server.Ma pPath("images\\ " +
Profile.UserNam e));
// Don't forget to check for IO errors ;)

Roger

On Sat, 23 Apr 2005 15:57:16 -0700 in
microsoft.publi c.dotnet.framew ork.aspnet, "Rudy"
<Ru**@discussio ns.microsoft.co m> wrote:
Hello All!

Can you dynamicly create a folder in ASP.net? Here is the set up. I have a
folder where I will store pics. What I would like to do is create a cookie,
track the user who has logged on to the site. If user deside to upload
pictures under thier profile, a subfolder under the images folder will be
created with the folder name as the users name. I would like to keep the pics
seperatred for each user.
TIA!!

Rudy


Nov 19 '05 #4
Hi,

In addition to what Rick mentioned about ASP file permissions, the
actual code to create a folder would be similar to:

System.IO.Direc tory.CreateDire ctory(Server.Ma pPath("images\\ " +
Profile.UserNam e));
// Don't forget to check for IO errors ;)

Roger

On Sat, 23 Apr 2005 15:57:16 -0700 in
microsoft.publi c.dotnet.framew ork.aspnet, "Rudy"
<Ru**@discussio ns.microsoft.co m> wrote:
Hello All!

Can you dynamicly create a folder in ASP.net? Here is the set up. I have a
folder where I will store pics. What I would like to do is create a cookie,
track the user who has logged on to the site. If user deside to upload
pictures under thier profile, a subfolder under the images folder will be
created with the folder name as the users name. I would like to keep the pics
seperatred for each user.
TIA!!

Rudy


Nov 19 '05 #5
Thanks guys! Just what I needed.

Rudy

"Roger Helliwell" wrote:
Hi,

In addition to what Rick mentioned about ASP file permissions, the
actual code to create a folder would be similar to:

System.IO.Direc tory.CreateDire ctory(Server.Ma pPath("images\\ " +
Profile.UserNam e));
// Don't forget to check for IO errors ;)

Roger

On Sat, 23 Apr 2005 15:57:16 -0700 in
microsoft.publi c.dotnet.framew ork.aspnet, "Rudy"
<Ru**@discussio ns.microsoft.co m> wrote:
Hello All!

Can you dynamicly create a folder in ASP.net? Here is the set up. I have a
folder where I will store pics. What I would like to do is create a cookie,
track the user who has logged on to the site. If user deside to upload
pictures under thier profile, a subfolder under the images folder will be
created with the folder name as the users name. I would like to keep the pics
seperatred for each user.
TIA!!

Rudy


Nov 19 '05 #6

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

Similar topics

5
11053
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 created in the wrong folder on the hard drive. Before I discovered these files, .NET kept trying to create a new project with _1 following the project name. Deleting those files corrected that problem. I deleted the Virtual Directory, rebooted, and...
4
4418
by: I_AM_DON_AND_YOU? | last post by:
There is one more problem I am facing but didn't get the solution. In my Setup Program I am not been able to create 2 things (when the program is intalled on the client machine ) : (1) create shortcut to my program/utility (2) Entry in Windows' Start --> Program Menu. Actually in my VB.Net solution I have two projects (1) MYPROGRAM (2) MYPROGRAM_INSTALLER. MYPROGRAM is a "Windows Application". MYPROGRAM_INSTALLER is a "SetUp Wizard"...
6
3934
by: jzdeng | last post by:
Hi, All I use VS 2005 to create a web service. The web service is used to create a sheared folder. It works fine we I run it from VS 2005. But, when I move it to inetpub, it does not work (folder is created but is not shared). Does anyone know how to solve this problem? Thanks.
8
2579
by: Paw | last post by:
Greetings. I use asp. what I need is is when a visitor comes to the site, I need it to check the host name. if "www.hometowndigest.com" is the host, then check a folder named "something" and if the folder does not exsist, create folder "www" and then copy folder "temp" and its contents. If the folder "www" is there, look in it, check to see if the files in folder "temp" are in there, if not, copy the files that are not from folder...
8
20368
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: Start with original thumbnails & two empty sub directories STEP 2: Create smaller versions of the originals for one sub directory STEP 3: Create thumbnail version of the originals the other sub directory STEP 4: Create an index.html pointing to the...
0
1379
by: 1333 | last post by:
I need to create a new folder every time the upload folder has 10 files uploaded to it. So when folder1 has 10 files, folder2 is created and becomes the upload folder, and when it has 10 files uploaded to it folder3 is created and so on..... Problem is that my code creates all the next folders all at once. I need it to create the next folder when it is required. i.e. when the previous folder has reached 10 files. If anyone can explain...
7
3489
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 the 'send' button, (only 'reply' etc as if it was a received message). I'm using exchange explorer to see the difference in webDAV properties
10
14303
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 planning to use VB2005 or C#. I look the help files and searched on the web, I cannot find the answer. Is this possble in ASP.NET 2.0? Thanks
4
4472
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 Project. So let's say I've created a Folder called "MyVBNet Classes" to hold these general-use VB.Net class files that I will eventually associate with various Projects I create. Now let's imagine I've created a class called "MyClass.vb" that...
5
3572
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 searching for a few hours and can't find a clear example on how to do it. i've already seen code blocks using webdav, directory services, but always related with creating active directory users or mail enabling users, not exactly what i'm looking for....
0
9552
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9249
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
8245
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...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
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
4877
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
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
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.