How to share a folder

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kashif73
    New Member
    • Sep 2008
    • 91

    How to share a folder

    Hi Everyone,
    How can I share a folder in ASP? I know how to create / delete folder using File System Object but can't figure out how to share a folder / files. Thanks.
  • kashif73
    New Member
    • Sep 2008
    • 91

    #2
    Anyone please. I am creating a system where users can create /delete folders. How to write code so that they can share their folders & its contents with others? Any hint please. Thanks.

    Comment

    • jhardman
      Recognized Expert Specialist
      • Jan 2007
      • 3405

      #3
      Maybe you could explain a little bit more. Does everyone have access to a newly created folder and you are trying to restrict access? If I was creating the folders and files I believe the method I use makes them freely available. If this is your problem, I would use a db-based login to determine who has access to a given file or folder.

      When a file is created is it only available to the user who created it? If that is the case then I don't even know how you made the file - unless possibly by creating it from the account of a windows integrated log-in user.

      Let me know and I will try to find a better solution.

      Jared

      Comment

      • kashif73
        New Member
        • Sep 2008
        • 91

        #4
        Jared, Thxs for reply. Its a file mangement system I have created. Where a user once he login to the system, there is a folder created for his username. Now in this folder he can create sub-folder / delete them. HE can also uplaod files in to these sub folders. This part I have done.
        Now how can I make sure (in ASP) that If he wants to share a particular folder & files in it with other user? I mean The shared folder could be accessbile to other users of the system, who would login to the system using their username & password & then will be able to access that particular SHARED FOLDER & FILES in it. I hope I am clear this time.

        Comment

        • jhardman
          Recognized Expert Specialist
          • Jan 2007
          • 3405

          #5
          I think I understand what you are saying, but I'm not sure how it is realized. Why is it that a given user doesn't have access to a different user's files? How do you prevent a user from seeing other user's files? This is the part I don't understand. I only change user permissions from the server, and I wouldn't know how to restrict a user from seeing other files (at least not without putting them in a restricted folder) so I'm not sure how you do it. Without understanding how you restrict user access, I don't see how I could help provide a solution.

          If it was up to me, I would have the whole thing based on a database rather than in the file system.

          Jared

          Comment

          • kashif73
            New Member
            • Sep 2008
            • 91

            #6
            Jared, Each user when login to the system, with his username & password, then a FOLDER is created in the root of my application with his USERNAME. e.g if my username is KASHIF so a folder with my name will b created & likewise for other users. Now every user can upload files into there respective folders , can create subfolders & so on. So every user has a seperate folder in which he is uploading files & downloading them. What I want is if I create a folder e.g PDFDOCS & upload few files in to it & want to share this folder with other users of the system, how can I do that?s othat other users of the system can see my SHARED folder & files in it. they can downlaod my shared files .....

            Comment

            • jhardman
              Recognized Expert Specialist
              • Jan 2007
              • 3405

              #7
              Originally posted by kashif73
              Jared, Each user when login to the system, with his username & password, then a FOLDER is created in the root of my application with his USERNAME. e.g if my username is KASHIF so a folder with my name will b created & likewise for other users. Now every user can upload files into there respective folders , can create subfolders & so on. So every user has a seperate folder in which he is uploading files & downloading them. What I want is if I create a folder e.g PDFDOCS & upload few files in to it & want to share this folder with other users of the system, how can I do that?s othat other users of the system can see my SHARED folder & files in it. they can downlaod my shared files .....
              Yes, you said that already. What I am asking is: "how do you prevent someone now from seeing someone else's files?" Are they just not given a link? When someone logs in are they automatically redirected to their own private folder? Do you have complex user permissions set up for each folder preventing any user but the creator to see those files? Any solution will have to take into account whatever method you used for preventing someone from seeing someone else's files.

              A database solution might still be the best regardless. When someone makes a shared file, instead of saving it to the private directory, you could save it to a database (most dbs have a "blob" or "binary" datatype) and another linked table could list users who have access to a given file. When someone logs in, if their name is on the list of shared files, they should be given links to see the shared files.

              Jared

              Comment

              • kashif73
                New Member
                • Sep 2008
                • 91

                #8
                YES the uers are automatically redirected to their private folders on login.
                Thxs for the DB suggestion, I'll look into this option.

                Comment

                • jhardman
                  Recognized Expert Specialist
                  • Jan 2007
                  • 3405

                  #9
                  Originally posted by kashif73
                  YES the uers are automatically redirected to their private folders on login.
                  Thxs for the DB suggestion, I'll look into this option.
                  If there are no user permissions in place preventing the user from seeing other folders, than another simpler db approach might be helpful. When you, Kashif, give permission for another user to access a file, add a reference to it in the db. eventually the db would look like this:
                  user fileName filePath
                  John Expenses \kashif\pdfdocs \Expenses.pdf
                  Fred Expenses \kashif\pdfdocs \Expenses.pdf
                  Jan Expenses \kashif\pdfdocs \Expenses.pdf
                  John Receipt History \kashif\pdfdocs \receipts.pdf

                  Then when John logs in, a script could check the db for any files beyond his own that are available to him, and display them - it would show him that he can have access to Expenses.pdf and receipts.pdf and provide links to access those files, but if Fred logs in, he only sees Expenses.pdf plus his own files and if Terry logs in he doesn't see any files but his own. This way you wouldn't have to save the file to the db, just put a reference to it there. Does this make sense?

                  Jared

                  Comment

                  • kashif73
                    New Member
                    • Sep 2008
                    • 91

                    #10
                    Yes it does make sense:). Thanks this approach seems a very good option I believe. Thanks for your patience & help. Now I have something to work on.
                    cheers.
                    KR

                    Comment

                    Working...