Sure, just do a lookup of some sort. I did this for a few files and just
used a switch-case. Here's some sample code that I saved in a file called
filelookup.cfm and include in the app page:

<cfswitch expression="#url.key#">
<cfcase value="87986">
  <cfset filename = "Blank Building and Business Inventory">
  <cfset fileextension = "mdb">
  <cfset mimetype = "application/x-msaccess">
</cfcase>
<cfcase value="87987">
  <cfset filename = "DMA Business Owner Survey">
  <cfset fileextension = "zip">
  <cfset mimetype = "application/x-zip-compressed">
</cfcase>
<cfcase value="87988">
  <cfset filename = "DMA Consumer Survey">
  <cfset fileextension = "zip">
  <cfset mimetype = "application/x-zip-compressed">
</cfcase>
<cfcase value="87989">
  <cfset filename = "DMAsec9">
  <cfset fileextension = "xls">
  <cfset mimetype = "application/x-msexcel">
</cfcase>
<cfdefaultcase>
<!---It's none of the acceptable files--->
<cflocation url="http://www.example.com";>
where's url.file?
</cfdefaultcase>
</cfswitch>

-Kevin

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 04, 2003 1:19 PM
> To: CF-Community
> Subject: cfcontent and URL Variables
>
>
> Sorry for all the CF posts lately, I just don't have the patience for
> cf-talk and all the noise :)
>
> I am spitting out pdf files using cfcontent.  With hard coded
> values to say
> what file I want it works great.  However I am now trying to do it by
> passing an encrypted value in a url that identifies what file the user
> wants.  Now the name of the file isn't what I set it to be (and output it
> as) rater it's like ...?key=87986.
>
> Can you not pass url variables to a page like this?
>
> BTW OS is win 2k, server iis, CFMX
>
> TIA
>
> Timothy Heald
> Overseas Security Advisory Council
> U.S. Department of State
>
> "that the free Constitution, which is the work of your hands, may be
> sacredly maintained" - George Washington, Farewell Address 1796
>
>
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=5
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=5
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5
                                

Reply via email to