• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Restrict Files and Images

New Here ,
Jan 11, 2007 Jan 11, 2007

Copy link to clipboard

Copied

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
TOPICS
Advanced techniques

Views

372

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 11, 2007 Jan 11, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 11, 2007 Jan 11, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 12, 2007 Jan 12, 2007

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation