I have PDF file data stored as varBinary(MAX) data in a MS SQL 2005 database

I have tried two ways of displaying the data.

1. Using a temporary file:
   <cfset TempPdf = ExpandPath('TempPdf2.pdf')>
   <cffile action="write" file="#TempPdf#" output="#binPdf#">
   <cfcontent type="application/pdf" file="#TempPdf#">
   This works.

2. The direct approach
I would prefer not creating a temporary file
so I tried the following which does NOT work.
   <cfcontent type="application/pdf">
   <cfoutput>#binPdf#</cfoutput>
This does not work.
The error is "File does not begin with %PDF-"

binPdf came from a MS SQL 2005 field defined as varBinary(MAX)

Any thoughts?
I have a feeling I am real close, .....

I found a thread that described a tag like
<cfcontent mimetype="application/pdf" variable="binPdf">
I guess that is old stuff now, but it sure looked good to me.

Thanks
Archie



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2305
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to