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