Thanks, I can retrive the image.


On Fri, Feb 27, 2009 at 10:06 AM, Paul Kukiel <[email protected]> wrote:

>
> I agree it adds extra load on the webserver and database and fills the
> database.
>
> Anyway here is the code to get the image back out.
>
> <cfquery name="imageQuery" datasource="mssql">
>    select dataFile
>    from file
>    where id = 1
> </cfquery>
>
> <cfimage action="writetobrowser" source="#imageQuery.dataFile#" /> or
> <cffile action="write" file="c:\imagefromdb.jpg"
> output="#imageQuery.dataFile#" />
>
> Paul.
>
> On Fri, Feb 27, 2009 at 10:39 AM, Jacob <[email protected]> wrote:
> >
> > Agree... store image file location in database that points to the image
> on
> > the server.  From experience, better performance in my opinion. We had
> > plenty of images to test it out... ;-)
> >
> > -----Original Message-----
> > From: Paul Kukiel [mailto:[email protected]]
> > Sent: Thursday, February 26, 2009 12:15 PM
> > To: cf-talk
> > Subject: Re: Convert Image to Binary
> >
> >
> > Managing images on disk is a better way but if you must use the data base
> > make sure you are using
> >
> > <cfqueryparam scfqltype="CF_SQL_BLOB"
> > vale="#toBase64(FinalMergedDisclosure)# />
> >
> > Which should work for you.
> >
> >
> > On Thu, Feb 26, 2009 at 11:14 AM, Priya Koya <[email protected]>
> wrote:
> >
> >>
> >> <cfset thisDir = expandPath(".")>
> >>
> >>    <cffile action="upload" fileField="image" destination="#thisDir#"
> >> result="fileUpload"
> >>        nameconflict="overwrite">
> >>                <cfdump var="#thisDir#">
> >>            <cfimage action="read" source="#fileUpload.serverfile#"
> >> name="myImage">
> >>                <cffile action="readBinary" file="#image#"
> >> variable="FinalImage">
> >> <br/>variable<cfdump var="#FinalImage#">
> >> <!--- <cfset Image_Binary =
> "#toBinary(toBase64(FinalMergedDisclosure))#">
> >> <cfdump var="#Image_Binary#"> --->
> >> <cfquery name="Query4" datasource="Platform" result="result_1">
> >> update table1 set Logo='#FinalImage#' where Name='John'
> >> </cfquery>
> >>
> >> I am getting an error: ByteArray objects cannot be converted to strings.
> >> I tried with tostring etc.. but didnt work
> >> Datatype for this column is varBinary(MAX).
> >>
> >> Any sugestions....
> >>
> >> Thanks,
> >> Priya.
> >>
> >>
> >
> >
> >
> >
>
> 

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

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319909
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to