In theory you could do the same with CF as you have seen in .NET.  In both
cases however, I'd say that the added load on the server isn't worth the
benefit of "protecting" the other files in the directory.

Typically there are few good reasons images that are included as part of a
page need to be protected at all, much less via CF.  If images or documents
do need to be protected in this manner they are usually moved out of the
webroot and handled using the CFCONTENT method suggested in another email.

I'm curious as to the requirement you are trying to satisfy and perhaps
someone will suggest a more elegant solution than running every request
through ColdFusion engine.

-Cameron

-----------------
Cameron Childress
Sumo Consulting Inc
---
land:  858.509.3098
cell:  678.637.5072
aim:   cameroncf
email: [EMAIL PROTECTED]

-----Original Message-----
From: Conan Saunders [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 10, 2004 11:57 AM
To: CF-Talk
Subject: serving non-CFM files w/ Cold Fusion

Say I have a directory containing these three files:

page.cfm
info.txt
image.gif

I want everything in this directory to be protected by my Cold Fusion login
for this application. For example if SESSION.IsLoggedIn is not defined,
bump to the login screen. I want the files to be located directly within
the web folders for direct downloading (assuming the proper login is
present); I don't want to store the files outside of the web site and then
serve them up through a CFM page.

Is it possible to protect non-CFM pages in this manner? I know how to do
this with .NET and would like to accomplish the same thing with CF. In .NET
I add a mapping in IIS for the extension "*" to the .NET dll and uncheck
"Check if file exists", sending all requests to my .NET code. Then, in
Application_BeginRequest I can rewrite request paths, authenticate the
request, etc. If the request is for a .NET code page, it gets processed,
and if the request is for an image or other static resource, the
appropriate file gets served up.

I would assume that with JRun and everything under the hood, this is
possible too with Cold Fusion, but I haven't been able to get it to work
and haven't been able to find any how-tos. All I've tried so far is adding
the mapping for "*" to the jrun .dll in IIS, and then sticking my code in
application.cfm, but that doesn't work.

Thanks for any help,
Conan
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to