Hi Dave,

Are you using CF8? what SQL data type is the column you are inserting into
and what does the SQL query look like?

I was hoping to avoid the tired old in-DB v. Out-of-DB conversation.  These
are small pictures and fewer than 100 so it shouldn't be a big deal.

Thanks,

-Nate 

> -----Original Message-----
> From: Dave Long [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, January 17, 2008 12:56 PM
> 
> I do it using a unix cron job timed to retrieve, unzip and 
> rename the files
> soon after they're refreshed on the remote server, then set a 
> CF scheduled
> task to run about 15 minutes later that deletes the existing 
> records and
> inserts the new ones from today.
> 

> Hi,
> 
> I'm trying to insert an Image into MS SQL Server 2005 
> database using CF 8.
> I started to work with the SQL Server 'Image' data type but 
> I'm not sure
> this data type is the best/correct choice.
> 
> Somebody has probably done this before, so what data-type 
> should/could I use
> in SQL Server - The choices include Image, binary, varbinary, and
> varbinary(max).  Should I be using the new image tags or 
> resorting to older
> methods to achieve the path of least resistance?
> 
> Here is a sample of what I am working on, here I am just 
> trying to read a
> file and place it in the database....
> 
> <cffile action="READBINARY" variable="ThisPicture"
> file="/var/www/images/staffpics/#staffID#.jpg">
>               <cfset myImage=ImageNew(ThisPicture)>
>               <cfquery name="qryinsertImage" datasource="#CMSDSN#">
>                       Update tblStaff
>                       Set staffphoto = <cfqueryparam
> value="#ImageGetBlob(myImage)#" cfsqltype="cf_sql_blob">
>                       Where StaffID = #staffID#;
>               </cfquery>
>       <!--- write out the image: check to make sure something 
> works.  --->
> <cfimage action="WRITETOBROWSER" source="#myImage#"><br>
> 
> I'm getting 
>       "The source file should contain an extension, so that 
> ColdFusion can
> determine the image format.  Verify your inputs. The source 
> file should
> contain an extension, so that ColdFusion can determine the 
> image format." 
> as an error.  It isn't clear, at least to me, where I can be 
> more specific
> about setting the image format - is this an error from SQL 
> server?  The
> manual says "If you do not specify a source image, an 
> "unknown source image
> format" error is generated", am I not pointing to my variable 
> correctly?
> The examples in the manual show an insert statement and I am 
> trying to do an
> update, is my query syntax messed up?
> 
> My next question is obviously about getting the images out of 
> the DB, so if
> there are any tricks to that, please feel free to elaborate.
> 
> Many thanks,
> 

> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

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

Reply via email to