Feb 10, 2011

How to display image in Binary format

<%@ Language = VBscript%>
<!--#Include File = ../conn.asp-->
<%
  dim rsPhoto
  set rsPhoto = server.CreateObject("ADODB.RecordSet")
 
  rsPhoto.Open "select * from  MUserPhoto where userid = '" & Request.QueryString("userid") & "' ",conn,adOpenForwardOnly,adLockReadOnly
 
%>

<% Response.ContentType = "image/jpeg"  %>
<% Response.BinaryWrite  rsPhoto("userphoto")%>
<% Response.ContentType = "text/html"  %>

<% rsPhoto.Close %>

No comments:

Post a Comment

What is the use of n-tier architecture and 3-tier architecture?

how to implement 3-tier architecture in asp.net using c#. 3-Tier architecture is also called layered architecture. Some people called it ...