macromedia.coldfusion.database_access
[Top] [All Lists]

Re: Downloading files from IMAGE datatype on SQL Server, old coldfusio

Subject: Re: Downloading files from IMAGE datatype on SQL Server, old coldfusion runtime
From: "-==cfSearching==-" <webforumsuser@xxxxxxxxxxxxxx>
Date: Sun, 24 Feb 2008 23:06:28 +0000 (UTC)
Newsgroups: macromedia.coldfusion.database_access

benmay123 wrote:
 > is only writing this into the word document:
 > D0CF11E0A1B11AE10000000000000000000000
   
 In MX+ blobs are returned as binary.  It looks like 4.5 does not handle them 
the same way.  If they were inserted as Base64 strings, into a clob field 

 <cffile action="readBinary" file="c:\someTestInputFile.pdf" variable="out">
 <cfquery name="insertAsClob" datasource="TheDSN">
     INSERT INTO TheTable (ClobColumn)
     VALUES (
     <cfqueryparam value="#ToBase64(out)#" cfsqltype="cf_sql_longvarchar">
    )
 </cfquery>

 I think you could use ToBinary to generate the file.  

 <cfquery name="getAsClob" datasource="TheDSN">
   SELECT       ClobColumn FROM TheTable WHERE RecordID = 1
 </cfquery>

 <cffile action="write" 
        file="c:\theOutputFile.pdf')" 
        output="#ToBinary(getClob.ClobColumn)#">

 But I do not know how to extract the blob if cfquery does not return it in 
binary format.  As an aside, I had no idea cfqueryparam existed way back in 
4.5!    


 PaulH wrote: 
 > ancient solution for ancient s/w:
 > http://www.adobe.com/cfusion/exchange/index.cfm?
 > 
searchfield=cfx_getImage&search_exchange=&num=25&startnum=1&event=search&sort=0&
Submit

 Yes, that is probably the way to go. I was just about to suggest looking in 
the exchange for old tags.



<Prev in Thread] Current Thread [Next in Thread>