insert/retrieve image into database SQL Server 2005/CF8?

2008-01-17 Thread Nathan C. Smith
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,

-Nate

~|
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:296741
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: insert/retrieve image into database SQL Server 2005/CF8?

2008-01-17 Thread Sonny Savage
I'll assume you're storing images in the DB because you don't have another
option...

Someone else with have to help with the error you're getting because I'm not
familiar with that part.  To display the image you'll need CF template takes
the staff ID as a parameter.  You'll query the value using the staff ID, set
the proper mime type (image/jpeg - I believe) and then output the column
value.  To display the image call the template in an image tag:
cfoutputimg src=staff_image.cfm?StaffID=#StaffID# //cfoutput

On Jan 17, 2008 11:00 AM, Nathan C. Smith [EMAIL PROTECTED] wrote:

 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,

 -Nate

 

~|
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:296745
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: insert/retrieve image into database SQL Server 2005/CF8?

2008-01-17 Thread Dave Long
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.

The CF task takes about 10 minutes or less to install about 6,000 records
and I have found it a good idea to put a link to my real estate site in the
Windows startup folder so I can actually eyeball the app first thing every
day... it has rarely been known to fail for various reasons.

But it works great almost all the time. I even have a separate site to boost
links to my hosted brokers' sites and listings at
http://www.northgoodsrealestate.com. I'm sure it could be designed better
but at my skill level, this seems to work ok for my folks and includes a
number of different methods for visitors to search for a listing.

Dave Long



-Original Message-
From: Nathan C. Smith [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 17, 2008 10:00 AM
To: CF-Talk
Subject: insert/retrieve image into database SQL Server 2005/CF8?

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,

-Nate



~|
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:296766
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: insert/retrieve image into database SQL Server 2005/CF8?

2008-01-17 Thread Nathan C. Smith
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


RE: insert/retrieve image into database SQL Server 2005/CF8?

2008-01-17 Thread Nathan C. Smith
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
 To: CF-Talk
 Subject: RE: insert/retrieve image into database SQL Server 2005/CF8?
 
 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.
 
 The CF task takes about 10 minutes or less to install about 
 6,000 records
 and I have found it a good idea to put a link to my real 
 estate site in the
 Windows startup folder so I can actually eyeball the app 
 first thing every
 day... it has rarely been known to fail for various reasons.
 
 But it works great almost all the time. I even have a 
 separate site to boost
 links to my hosted brokers' sites and listings at
 http://www.northgoodsrealestate.com. I'm sure it could be 
 designed better
 but at my skill level, this seems to work ok for my folks and 
 includes a
 number of different methods for visitors to search for a listing.
 
 Dave Long
 
 
 
 -Original Message-
 From: Nathan C. Smith [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, January 17, 2008 10:00 AM
 To: CF-Talk
 Subject: insert/retrieve image into database SQL Server 2005/CF8?
 
 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,
 
 -Nate
 
 
 
 

~|
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:296769
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: insert/retrieve image into database SQL Server 2005/CF8?

2008-01-17 Thread Claude Schneegans
 There's nothing wrong with storing images in a modern RDBMS.

Except may be people having problems and asking questions in forums ;-)

-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
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:296773
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: insert/retrieve image into database SQL Server 2005/CF8?

2008-01-17 Thread Dave Watts
 I was hoping to avoid the tired old in-DB v. Out-of-DB 
 conversation.

Like the war between good and evil, that conversation is eternal. There's
nothing wrong with storing images in a modern RDBMS.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~|
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:296771
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: insert/retrieve image into database SQL Server 2005/CF8?

2008-01-17 Thread Nathan C. Smith
I didn't think so either...

You are always a great resource Dave, any thoughts on my original question?

'http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54861#29676
6' 

-Nate

 -Original Message-
 From: Dave Watts [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, January 17, 2008 1:54 PM
 To: CF-Talk
 Subject: RE: insert/retrieve image into database SQL Server 2005/CF8?
 
  I was hoping to avoid the tired old in-DB v. Out-of-DB 
  conversation.
 
 Like the war between good and evil, that conversation is 
 eternal. There's
 nothing wrong with storing images in a modern RDBMS.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 
 Fig Leaf Software provides the highest caliber vendor-authorized
 instruction at our training centers in Washington DC, Atlanta,
 Chicago, Baltimore, Northern Virginia, or on-site at your location.
 Visit http://training.figleaf.com/ for more information!
 
 

~|
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:296776
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: insert/retrieve image into database SQL Server 2005/CF8?

2008-01-17 Thread Dave Watts
 You are always a great resource Dave, any thoughts on my 
 original question?

Unfortunately, I won't have access to a SQL Server 2005 machine until the
weekend.

That said, you should be able to rewrite your original code like this:

cfimage source=/var/www/images/staffpics/#staffID#.jpg name=myImage 
cfquery name=qryinsertImage datasource=#CMSDSN#
Update tblStaff
Set staffphoto = cfqueryparam value=#ImageGetBlob(myImage)#
cfsqltype=cf_sql_blob
Where StaffID = #staffID#;
/cfquery

I replaced your CFFILE with CFIMAGE, which can read the file from disk for
you.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~|
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:296779
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: insert/retrieve image into database SQL Server 2005/CF8?

2008-01-17 Thread Dave Long
-
From: Nathan C. Smith [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 17, 2008 1:09 PM
To: CF-Talk
Subject: RE: insert/retrieve image into database SQL Server 2005/CF8?

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
 To: CF-Talk
 Subject: RE: insert/retrieve image into database SQL Server 2005/CF8?
 
 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.
 
 The CF task takes about 10 minutes or less to install about 
 6,000 records
 and I have found it a good idea to put a link to my real 
 estate site in the
 Windows startup folder so I can actually eyeball the app 
 first thing every
 day... it has rarely been known to fail for various reasons.
 
 But it works great almost all the time. I even have a 
 separate site to boost
 links to my hosted brokers' sites and listings at
 http://www.northgoodsrealestate.com. I'm sure it could be 
 designed better
 but at my skill level, this seems to work ok for my folks and 
 includes a
 number of different methods for visitors to search for a listing.
 
 Dave Long
 
 
 
 -Original Message-
 From: Nathan C. Smith [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, January 17, 2008 10:00 AM
 To: CF-Talk
 Subject: insert/retrieve image into database SQL Server 2005/CF8?
 
 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,
 
 -Nate
 
 
 
 



~|
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:296781
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: insert/retrieve image into database SQL Server 2005/CF8?

2008-01-17 Thread Dave Long
My apologies, Nate. I didn't catch on that your main problem was with the
images. 

Ours are stored on a separate server and referenced through the record ID.
Since I don't deal with the images, only the listings, my job is much
simpler.

There's no reason I know of why you can't use something like ImageMagick to
manage the images and rename them with the MLSnumber as part of the file
name.

Are you familiar with that?

Dave Long

-Original Message-
From: Nathan C. Smith [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 17, 2008 2:14 PM
To: CF-Talk
Subject: RE: insert/retrieve image into database SQL Server 2005/CF8?

I didn't think so either...

You are always a great resource Dave, any thoughts on my original question?

'http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54861#29676
6' 

-Nate

 -Original Message-
 From: Dave Watts [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, January 17, 2008 1:54 PM
 To: CF-Talk
 Subject: RE: insert/retrieve image into database SQL Server 2005/CF8?
 
  I was hoping to avoid the tired old in-DB v. Out-of-DB 
  conversation.
 
 Like the war between good and evil, that conversation is 
 eternal. There's
 nothing wrong with storing images in a modern RDBMS.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 
 Fig Leaf Software provides the highest caliber vendor-authorized
 instruction at our training centers in Washington DC, Atlanta,
 Chicago, Baltimore, Northern Virginia, or on-site at your location.
 Visit http://training.figleaf.com/ for more information!
 
 



~|
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:296782
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: insert/retrieve image into database SQL Server 2005/CF8?

2008-01-17 Thread Nathan C. Smith
Bingo, I should have been using cfimage to read the file!

Thanks Dave!  BTW, the SQL you fixed works the same with the VarBinary(MAX)
and the image datatypes.
Now if they can just get that image bug fixed...  Resizing my images is
causing a page timout.

Thanks.

-Nate 

 -Original Message-
 From: Dave Watts [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, January 17, 2008 2:32 PM
 To: CF-Talk
 Subject: RE: insert/retrieve image into database SQL Server 2005/CF8?
 
  You are always a great resource Dave, any thoughts on my 
  original question?
 
 Unfortunately, I won't have access to a SQL Server 2005 
 machine until the
 weekend.
 
 That said, you should be able to rewrite your original code like this:
 
 cfimage source=/var/www/images/staffpics/#staffID#.jpg 
 name=myImage 
 cfquery name=qryinsertImage datasource=#CMSDSN#
 Update tblStaff
 Set staffphoto = cfqueryparam value=#ImageGetBlob(myImage)#
 cfsqltype=cf_sql_blob
 Where StaffID = #staffID#;
 /cfquery
 
 I replaced your CFFILE with CFIMAGE, which can read the file 
 from disk for
 you.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 

~|
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:296791
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4