Hi Archie, This is just me, but I don't store images or pdfs in a db, I generally upload both and store only image or pdf names in the db. Storing them in a db would produce a rather bloated db after a short while ;) Then I'll reference the directory I store them in using a variable name somewhere above my query, ie; <cfset imgDir="C:\wwwroot\mysite\images" /> then use the "imgDir" in my output, same with the pdf files. Not sure if this is what you were after but it works for me ;) HTH
Bob -----Original Message----- From: Archie Campbell [mailto:[EMAIL PROTECTED] Sent: Monday, December 04, 2006 7:34 PM To: CF-Newbie Subject: HowTo store a PDF or JPEG file in a MS SQL 2005 database I have PDF files and possibly some JPEG files that I want to store in a MS SQL Server 2005 database. I was thinking I would use a VarBinary(MAX) field. Is this a good way to do it? I ask this because I got "ByteArray objects cannot be converted to strings" for the line SET TranDataBinary = '#binPdf#' in the following test code <cffile action="READBINARY" file="#InPdfFullname#" variable="binPdf"> <cfquery name="updateTransfer" datasource="xxxxxxx"> UPDATE fmTransfer SET TranDataBinary = '#binPdf#' WHERE TranFormId = 'AAA158AC' </cfquery> Thanks Archie Campbell ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:2298 Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
