----- Original Message -----
From: "Conan Saunders" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, February 10, 2004 12:56 PM
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.

I just did a quick test with CF5/IIS5 and this approach appears to work for
me.  I created a directory on an existing web site and then in IIS an
application with the extension * mapped to C:\CFusion\bin\iscf.dll.  If I
request an existing file in the directory, for example "test.gif" or
"test.pdf" it fires application.cfm.  Of course, if a file _doesn't_ exist,
CF throws a 404 error.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to