Results 1 to 5 of 5

Thread: Retriving images from database

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    7

    Retriving images from database

    Hey all I need some help with displaying some images that are in a database. Currently when I try to display them they come out in binary form and I am stumped on how to correct it.

    Server info:

    WWW Server:
    Windows Server 2003
    ASP .Net
    Pages are .aspx written in VBScript

    Database Info:
    MS SQL Server 2000

    Problem code:

    <%
    Dim rs
    rs = Server.CreateObject("adodb.recordset")
    rs.Open("Select * From avatar", Application("Conn"))
    If not rs.eof then
    Do Until rs.eof
    Response.ContentType = "image/gif"
    Response.binarywrite(rs.fields("a_avatar").value)
    rs.movenext
    Loop
    rs.close
    End If
    %>

    As stated above the result is display of the three images in the database in binary form.
    http://test.adiktclan.com/test.aspx

    Any help is greatly appreciated.

    Thanks,

    John K
    MCSA, A+

  2. #2
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Retriving images from database

    Have you seen the suggestion I made here http://www.vbforums.com/showthread.p...tpost&t=321793

    Its best not to cross post in 2 forums, most of us visit DB & ASP forums.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    7

    Re: Retriving images from database

    I have tried setting the page up that way but it produces the same that i am already getting witch is like 20 pages of binary with small littel image boxes at the start of each each image

  4. #4
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Retriving images from database

    Quote Originally Posted by mcp87
    I have tried setting the page up that way but it produces the same that i am already getting witch is like 20 pages of binary with small littel image boxes at the start of each each image
    What did you define the field type as?
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    7

    Re: Retriving images from database

    I am asuming you are refering the field in the database, that field is defined as image

    Please post future responses on topic in database section

    http://vbforums.com/showthread.php?t=321793
    Last edited by mcp87; Jan 27th, 2005 at 04:01 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width