0

im doing my first asp.net MVC project here,

i need to be able to create a folder for a new user im registering. so i want it to be that when i register a user lets say name is david, a folder named david is also created. purpose is that later i want to save contents for each user.

is there any good tutorial on how to do this? coz i dont have a clue!

i want to learn it.

4
  • do you know c#? asp.net? Commented Apr 21, 2011 at 4:24
  • 1
    A side note: lots of people have the same name; you'll have collisions fast. Commented Apr 21, 2011 at 5:03
  • @VinnyG, yes i know but still in a basic level.im more to c# standalone app.not quite familiar yet with mvc. Commented Apr 21, 2011 at 6:20
  • ok, so are you allright with the answers or you need more help? Commented Apr 21, 2011 at 12:19

2 Answers 2

1
Directory.CreateDirectory(Path.Combine(path, newFolder)); 

It'S basicly that simple but you have to add write access to IIS_IUSR, a quick search result in this post : IIS AppPoolIdentity and file system write access permissions but it depends on witch version of IIS do you use.

Let me know if you need more help!

Sign up to request clarification or add additional context in comments.

Comments

0

See System.IO.Directory.CreateDirectory

A quick note: do not create the folder within your web site structure since this will recycle the app domain. So you need to use some other path as the root and just give the user under which the site is running the relevant permissions.

Determining the correct user can be done in a couple of ways. A quick Internet search for your environment should do the trick.

HTH

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.