3 Replies Latest reply on Aug 15, 2011 9:21 AM by Reed Powell

    File Server and Permissions


      We are using Coldfusion 8.  Does anyone know a way to set permissions on a file server so my users in my cfapplication are the only people that can access the files in a specific folder on that server?  I ask this because we have a lot of public folders on this server and now we want to add some private folders only accesable via people using the application.

        • 1. Re: File Server and Permissions
          Reed Powell Level 3

          If what you are asking is "how can I setup a folder on my fileserver so that files that are accessed through my CF application using tags such as CFFILE are the only ones that can access it" then the answer is to 1) Change the login information for the CF services from the local system service to a domain account, being sure to give that account admin privs, 2) on the file server only give access to the domain user that you just created in step 1.


          However, if your CF app is allowing users to access that folder via mechanisms like HREF links (ie, where the account accessing the folder is not the CF account, but the user that is logged into windows running a browser), then you need to put those users in a group and give that group the sole access to the folder.


          Scenario #1 presumes that your CF app is doing some sort of authentication so that it knows who is allowed to use it to get to that folder. 



          • 2. Re: File Server and Permissions
            r.a.cain Level 1

            The application requires a user to log into the system.  There are many users and they do access these files via HREFs.  When someone browses the file server like so http://www.website.com/fileserver, it lists all the folders on that server and you can click on each folder and browse through the folders.  That is generally ok, except for this one folder which we want users who have successfully logged in, to access this "securedfolder". 


            Note: Sorry in advance for asking stupid questions but I'm not a server admin.  :-)


            Can we give permissions to the folder and when someone successfully logs into the system, then I create a session variable that allows the user access to the folder?

            • 3. Re: File Server and Permissions
              Reed Powell Level 3

              The answer is in my previous posting - scenarion #2.  If your users are getting to the file share via HREF links, then your application really isn't involved in the access at all.  The accessing is between the browser running on the user's PC under the user's Windows login, and the fileserver.  Absolutely zero of that traffic is going through your CF application.  That's why the answer is to setup the Windows AD access for those users and the share to control the access to the share.


              How are you authenticating users in your CF app?  An alternative approach how you described would be to use CFFILE and CFDIRECTORY to get the list of folders in the share, and use your authentication to control which folders you display on the screen, and the access to them via CFFILE and CFCONTENT for getting them to the user's PC.  Check out the docs for those tags, there are lots of examples there, as well as all over the Internet (Google is your friend).



              1 person found this helpful