Vad,
An image is a couple of 3 informations : the image name, the image data an dthe image type. You have to store all those informations in your database (esp if you have different kind of images stored there... jpg, gif)
Then you need to create a file that brings teh image out of the database and you link to this page as you link to a normal image <img scr="showimage.asp" border....>
now here is a code that can do this:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Option Explicit%>
<!-- #include file="connection.asp" -->
<!-- #include virtual="/adovbs.inc" -->
<% response.Buffer = True
dim strSQL, objRS_DispIm
strSQL = "Select IMGDATA, IMGTYPE from TABLENAME where ID = '" & request("id") & "'"
set objRS_DispIm = server.CreateObject("ADODB.REcordset")
objConn.open
objRS_DispIm.open strSQL, objConn, 2, 4
if (objRS_DispIm.EOF and objRS_DispIm.BOF) then
response.Write("Image not found")
else
response.ContentType = trim(objRS_DispIm("IMGTYPE "))
response.BinaryWrite objRS_DispIm("IMGDATA")
end if
objRS_DispIm.close
set objRS_DispIm = nothing
objConn.close
set objConn = nothing
%>
Save this code into a file called ShowImage.asp and then call it as I said <img scr = "ShowImage.asp?id=idnumber"> Of course you replace ID with whatever you need to find the exact image you wanna display.
I hope it works. For me it does
