We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,437 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

retrieve image from mssql using ASP

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
1 Day
Discussion Span
1 Year Ago
Last Updated
2
Views
jcarbillon
Light Poster
43 posts since Aug 2011
Reputation Points: 10
Solved Threads: 2
Skill Endorsements: 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.

vsmash
Junior Poster
125 posts since Feb 2010
Reputation Points: 9
Solved Threads: 17
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0556 seconds using 2.64MB