3 Replies Latest reply on Jan 12, 2007 12:32 AM by ICI-MASA

    Restrict Files and Images

    ICI-MASA
      Hi,

      does anyone have a good link or can tell me how to restrict access to files and images.. Only logged in users
      are allowed to see their files and images.. I probebly need to remove the images from the www-root/images folder
      to a folder which can not be accessed by simply writing the image or file name in the url.

      So need some help here guys..

      thx
      Martin
        • 1. Re: Restrict Files and Images
          dempster Level 1
          If you put an image file in a folder outside the web root, you can then use a cfm program to display the image.

          For example, if you create showpic.cfm as this:

          <CFSET fpath="D:\files\images">
          <CFSET fname="myimagefile.jpg">
          <CFCONTENT TYPE="image/jpeg" FILE="#fpath#\#fname#" DELETEFILE="No">

          You display it as IMG SRC="showpic.cfm"

          If this is placed in a directory with an application.cfm and log-in protection, it should restrict access to your images.
          • 2. Re: Restrict Files and Images
            AndreFusion
            CFCONTENT ties up a "simultaneous request" for the duration of the download. So, if say 10 users download a file at the same time your site can become unresponsive. The larger the file download the worse the problem.
            • 3. Re: Restrict Files and Images
              ICI-MASA Level 1
              thx for the reply.. but sblue do you know a better way to do this then... the download will mostly be log files that are
              located in different folders which are user specific.