|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
How to show the image back from database using asp
Hello, friends. I have in the database two columns, one for picture_id and one for image. Then I want to show the image which the user sent into the database.
I am using sql server 2000, how should I write the code in asp so that it can show the image not the disordered characters on screen. I have code as following but the output is disordered characters. Many thanks in advance! <title>show image</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <% set connGraph=server.CreateObject("ADODB.connection") connGraph.Open "project" set rec=server.createobject("ADODB.recordset") strsql="select image from image where picture_id=1" rec.open strsql,connGraph,1,1 Response.ContentType = "image/*" Response.BinaryWrite rec("image").getChunk(7500000) rec.close set rec=nothing set connGraph=nothing %> </body> </html> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > How to show the image back from database using asp |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|