> If I wanted to do something along the lines of: > > joe.cfm?img=/images/go.jpg > > and have joe.cfm turn into the actual image how would i > accomplish such a task? i'm interested in keeping from > being able to look at photos unless they are logged in > and i want cfm to manage the logging in via session vars. > > the images directory would not be web accessible obviously > but the .cfm page would call the images from that dir. > > how can i make the browser think that > joe.cfm?img=/images/go.jpg is an actual jpeg and not a > cfm file with a jpeg in it?
You'd need your CFM file to use CFCONTENT to return a JPEG, and not return anything else (no HTML tags or other text output). <!--- joe.cfm ---> <cfif IsUserInRole("PictureViewer")> <cfset ImageToShow = "go.jpg"> <cfelse> <cfset ImageToShow = "blank.jpg"> </cfif> <cfcontent type="image/jpeg" file="#ImageToShow#"> > how server intensive is this task? Unfortunately, it's pretty intensive, and I wouldn't recommend it in a high-usage environment. There are alternatives, such as the use of symlinks or junctions, or the use of web server authentication, that you can use to offload this kind of thing from CF, if you're in that sort of environment. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm