2 Replies Latest reply on Aug 21, 2006 6:54 AM by cfdoogan

    cf access to protected directory

      IIS 6 & CFMX7
      Does anyone know a way to protect a directory and then have CF access a file in that folder (.jpg) and serve it in a page.

      The idea is to deny a user from free accss to photos (www.mysite.com/images) but yet have CF read a file in the directory and display it in a page? This would prevent a user from viewing source of a page and just sending a link to someone.

      I'd rather have the user send a link like www.mysite.com?picture_id=23 and have CF query for the file name , access the protected folder and file, and display the picture.
        • 1. Re: cf access to protected directory
          dempster Level 1
          You can place your image files in a directory on the server that is not under the web root, so they can't be retrieved directly. Then you can serve them using the CFCONTENT tag, which can read a file anywhere on the server and send the content to the browser. Your IMG tag could call a program that gets the image, such as showimage.cfm?picID=23.

          This doesn't really protect your photos, since they end up in the user's browser cache and can also be copied through a screen print. But it makes it a little harder.
          • 2. Re: cf access to protected directory
            cfdoogan Level 1
            CF can be any user and use their permissions for local and other server files. Start > Run services.msc > right click CF App > Properties > Logon Tab