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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing images

Status
Not open for further replies.

ahksar

Programmer
Jan 11, 2001
43
US
I need to store images in an MS access database, and retrieve them using Coldfusion. Can I just put the url in the database, or can I store the images, and if so, how can it be retrieved? I have no idea how to go about this, so any help will be greatly appreciated.
Thanks in advance.
 
when storing images into database, you are acctualy storing file name, e.g. "imageName.gif"; there is no need to do the url, or image path, as that might be changed in the future; to output that image, analize this example:

<cfquery name=&quot;getImages&quot; datasource=&quot;dbn&quot; dbtype=&quot;ODBC&quot;>
SELECT fileName
FROM TableName;
</cfquery>


<img src=&quot;images/#fileName#&quot; height=&quot;100&quot; border=&quot;0&quot; alt=&quot;&quot;> Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
don't forget to use cfoutput:

<cfoutput query=&quot;getImages&quot;>
<img src=&quot;images/#fileName#&quot; border=&quot;0&quot; alt=&quot;&quot;>
</cfoutput>

Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top