Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/03/2003, 09:00
Avatar de sedos
sedos
 
Fecha de Ingreso: junio-2002
Mensajes: 116
Antigüedad: 22 años, 10 meses
Puntos: 0
mostrar una imagen

Buenas, tengo un problemilla, estoy intentando sacar de una base de datos una imagen en formato binario, pero el problema es cuando pones cualquier etiqueta HTML ya no se ve la imagen sino un monton de simbolos , este es el codigo:

Si alguien me echara una mano se lo agradecería

<%
' -- file.asp --
' Retrieves binary files from the database

Response.Buffer = True

' ID of the file to retrieve
Dim ID
ID = Request("ID")

If Len(ID) < 1 Then
ID = 7
End If

' Connection String
Dim connStr
connStr = " Provider=SQLOLEDB;server=Julio;database=images;uid
=sa;pwd="
' connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
' Server.MapPath("FileDB.mdb")

' Recordset Object
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")

' opening connection
' rs.Open "select [image_blob],[FileData] from MYIMAGES where ID = " & _
rs.Open "select [image_blob] from MYIMAGES where ID = " & _
ID, connStr, 2, 4

If Not rs.EOF Then
' Response.ContentType = "image/gif"
' Response.ContentType = rs("")
Response.BinaryWrite rs("image_blob")
End If


rs.Close
Set rs = Nothing

%>