Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying Images with CF/ Ms Access

Status
Not open for further replies.

newtocf

Programmer
Jun 20, 2003
2
US
Could someone let me know how to display images from coldfusion, using ms access or mysql dms? What is the best way to do it? use a link from the database or make the field a blob or whatever? What is the prefered way and why?

Thanks For Your Time
Damon
 
I do this with several sites. I usually have a field in a table for the image file name (image1.jpg, for example). Then I make sure all of the images are in a specific folder (ImageFolder, for example). Then in my cfquery, I have it select the image name from the table, and I have it output into a html image tag.

<CFQUERY datasource=&quot;MYDSN&quot; NAME=&quot;GetDocs&quot;>
SELECT Record1, Record2, Record3, Image
FROM tbl1
</CFQUERY>

<cfoutput>

<img src=&quot;whateverdirectory/ImageFolder/#Image#>
</cfoutput>

This would output in the HTML as:
<img src=&quot;whateverdirectory/ImageFolder/image1.jpg>

Hope this helps,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top