Posts Tagged ‘tables’

Downloading an image from database

Friday, June 11th, 2010
A project I'm working on involves storing asset references in a database and then later downloading the images. Why? because it takes bloody ages! So assuming you have a table called Assets, and all the right fields. There's two options, using cfhttp or cfimage (cf8+).
<cfset pathToActualImage = "http://www.google.com/images/hello.jpg" />
<cfset tempFileName = "test.jpg" />
<cfset tempPath = "C:\temp\" />
<cfhttp url="#pathToActualImage#" file="#tempFileName#" path="#tempPath#">
Or
<cfimage action="write" destination="#tempFileName##tempPath#" source="#pathToActualImage#" />
I'd recommend to maybe use cfimage because
  • Share/Bookmark

Query of Queries

Sunday, February 28th, 2010
Query of Queries (QoQ) is great little concept, for a while I never knew when I would ever use this up until a few months ago. Web services generally return strings, but more commonly xml. Then you have some minority that return query results. This is where QoQs work perfect, check out the code snippet below: // Let's say qryResults has 4 columns - (Name, Address, Phone, Email) SELECT Name, Address, Phone… Continue reading
  • Share/Bookmark