I will create an ASP.NET Web Application like this;
- Users can login their own
usernameandpassword. - Users can file
uploadtheir own folder (I define the folders manually), and also they can see all files in their own page and they can download them.
I think I can use an architecture like this;
- I should use
ASP.NET Login Controls, we all agree with that. But I also should use C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe andASP.NET Web site Administration Tool? What does exactlyaspnet_regsql.exedo? What doesAdministration Tooldo? They are (Login controls + aspnet_regsql.exe + Administration Tool) only I need for creating a user login system? - For file upload I think to use
File Uploadcontrol. Then, For example; if I have a user “A”, folder should be likehttp://ourserver/A. I have no idea how can I upload file to specific folder. And how can I show to users their own uploaded files? (Also users should download them) Is there anyasp.netcontrol for doing this ?
EDIT: I prefer step by step explanation rather than giving some code. I want to also understand what these applications are doing ?
1) If you run the regsql tool, it will popup a screen asking for some sql information and then create a set of tables relative to membership etc. If you start a basic MVC 3 application, it comes with an account controller, login, logout, forgot password all wired up. This talks to that database. Your alternative is to create a custom membership provider, there are lots of tutorials out there for doing that. You can control more things with the custom membership provider, but it’s a bit more work.
2) AmRans example code is perfect for saving the actual file. As far as the folder for the given user goes, then I would probably configure a base directory in your web.config, then;
although if you’re using .NET 2, then that might remain;
For viewing of those files, if the user is logged in, you can query the save directory + username and list out all the files in that.