Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I am a beginner at asp.net and web development and recently I have started working on user accounts and login. That all works well, a user can login and logout etc. My next task was to upload files on the server/database, which I was successfully able to achieve. So, now I can upload files, remove them from the server/database etc. Now, the problem that I am facing is when trying to upload files, I want it to be user specific.

So, for example: If person 'A' is uploading files 1,2,3. I want it to stay on the server/database and show them when he logs in again. If person 'B' is uploading 8 and 9, likewise for him too.

So, in this case, could someone direct me to some tutorials or any help that I could use in trying to achieve this?
Posted
Comments
Sushil Mate 17-Jul-13 7:13am    
are you storing the files on server database? why?

You can:

1. Use private folders - create a folder for each user and have them work with their private folder only (and then perhaps also add a shared folder etc).
2. You can manage permissions. This can be done either on the application level - keep records of the files uploaded by the users, in your DB and manage what users see and what they can write/read accordingly, OR it can be done based on authorization level, you can manage the windows based permissions of the files.

Cheers,
Edo
 
Share this answer
 
Do you have a unique id for each user?
There are many ways...

When you save in the database, identify the row with the user id.
Or
If you save it as a file, create folders with user ids like "files/%id%/" and save files inside. You can list files by user using the path and System.IO.Directory.GetFiles.
Or
You can save it in the database, using the user id and a Guid or the path to identify the file, it will be easy to list and show a link to user, like in a grid or something.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900