Ok I've done this before, and I am sure I got the details from Shaun
Cornfields Blog's.
Basicaly you need a separate script called from the image tag.
<img src="getimage.cfm?recordID=#num#">
This script them gets the data from the data base.
<cfquery>
SQL to get image
</cfquery>
Then flushes the Output Cache and opens an output stream to the browser
with the correct headers.
<cfscript>
context = getPageContext();
context.setFlushOutput(false);
response = context.getResponse().getResponse();
out = response.getOutputStream();
response.setContentType("image/jpeg");
response.setContentLength(arrayLen(queryname.filedContent));
out.write(queryname.filedContent);
out.flush();
out.close();
</cfscript>
Try searching for getOutputStream() and Coldfusion.
GC
Original Message:
-----------------
From: Phil Evans [EMAIL PROTECTED]
Date: Wed, 16 Jun 2004 15:31:48 +1000
To: [EMAIL PROTECTED]
Subject: [cfaussie] Display image from db
Hi All,
I am storing an image in a db - I need to do this so that it can be accessed
by crystal reports.
I am trying to figure out how I can retrieve the image from the db, and
display via cfml.
Any thoughts?
Thanks,
Phil.
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/
--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/