Place your non-CF files into a non-web folder (say,
C:\SecureFiles\MySite\ or whatever) and then serve those files through a
CF script. For example, perhaps the file request link looks like this:
href="index.cfm?event=file.download&id=xyz"
Then the file.download event checks the session; if successful, query
the database to get the file name and path and then use CFCONTENT to
serve the actual file back to the request:
<cfset variables.thisFile = application.fileroot &
fileQuery.thisFileName />
<cfheader name="content-disposition" value="attachment;
filename=#fileQuery.thisFileName#" />
<cfcontent deletefile="Yes" file="#variables.thisFile#"
type="#fileQuery.thisFileMIMEType#">
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324240
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4