On 3/9/07, James Holmes wrote:
....

> temporary file and use cfcontent to serve it from there. The first
> method works great for images  - other docs may need the second
> method.
>

I've used cfcontent for every kind of file, and it works fine.  The only
thing you need to vary at times is the "render in browser" or "prompt
for save".  Here's a snippet:

<cfsetting enablecfoutputonly="true" />
<cfif structKeyExists(url,"d")>
 <cfset cvalue = "attachment;">
</cfif>
<cfset cvalue = cvalue &
"filename=""#fileQry.FileName#.#fileQry.FileExt#""">
<cfoutput query="fileQry"><cfcontent
type="#contentType#/#contentSubType#"><cfheader name="Content-Disposition"
value="#cvalue#">#toString(toBinary(FileData))#</cfoutput>

This is using MySQL and a longtext field with base64 data,
you could drop the toBinary() probably.

If you're doing it a bunch, a "file cache" may be in order...
unless your webserver caches that stuff?


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272279
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to