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

cf access to protected directory

Explorer ,
Aug 18, 2006 Aug 18, 2006

Copy link to clipboard

Copied

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

Views

219

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 ,
Aug 19, 2006 Aug 19, 2006

Copy link to clipboard

Copied

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.

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
Explorer ,
Aug 21, 2006 Aug 21, 2006

Copy link to clipboard

Copied

LATEST
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

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