0

I cant load the image from database

please help..

strsql = "select top 1 id,shape from table"
set rsgetimage = server.CreateObject("adodb.recordset")
rsgetimage.open strsql,application("connectionstring")



   Response.Expires = 0
   Response.Buffer = TRUE
   Response.Clear

   Response.BinaryWrite(rsgetimage("shape"))
   Response.ContentType = "image/png"


rsgetimage.close

it just display an x icon


- thanks

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by vsmash
0

1. you have written the image before specifying the contentType so asp is defaulting to text/html.

2. response.buffer and response.expires should appear first on your page with response.contentType

3. you have no code to handle empty results.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.