Professional Web Applications Themes
  1. #1

    Default Display Image Binary data in Web Browser

    I'm returning the binary data from my webservice and it works but I'm
    having problems rendering the image in an <img> tag in my web browser.
    The code I'm using is below:


    Dim wsurl
    wsurl = "http://localhost/wsImage/wsImage.asmx/GetImage?sSpecNo=" & "1"
    Dim xmlhttp
    Set xmlhttp=Server.CreateObject("MSXML2.ServerXMLHTTP" )xmlhttp.open
    "GET",wsurl,false
    xmlhttp.send
    Response.ContentType = "image/png"
    Response.BinaryWrite xmlhttp.responsebody
    Set xmlhttp=nothing
    Response.End

    I am calling this code from my image tag

    klj_mcsd@hotmail.com Guest

  2. #2

    Default Re: Display Image Binary data in Web Browser

    One way to do is is mage the img src point to an ASPX page that outouts
    the binary. Does this answer your question?

    Keenan Newton Guest

  3. #3

    Default Re: Display Image Binary data in Web Browser

    Yes its a problem. You can construct an ASPX page with a graphic <IMG> with
    src= "/images/mydownload.jpg". You can then write the binary data to the
    exact same file location, and over-ride the "dummy" file that was there
    already. I have an example somewhere, so let me know if this isn't clear
    and I'll dig it out for you - it may take a while!
    --
    Pete Wood
    Contact me at [url]http://www.webserviceshelp.org[/url] for more help
    __________________________________________________ _______


    <klj_mcsd@hotmail.com> wrote in message
    news:1121109118.316348.196630@g47g2000cwa.googlegr oups.com...
    > I'm returning the binary data from my webservice and it works but I'm
    > having problems rendering the image in an <img> tag in my web browser.
    > The code I'm using is below:
    >
    >
    > Dim wsurl
    > wsurl = "http://localhost/wsImage/wsImage.asmx/GetImage?sSpecNo=" & "1"
    > Dim xmlhttp
    > Set xmlhttp=Server.CreateObject("MSXML2.ServerXMLHTTP" )xmlhttp.open
    > "GET",wsurl,false
    > xmlhttp.send
    > Response.ContentType = "image/png"
    > Response.BinaryWrite xmlhttp.responsebody
    > Set xmlhttp=nothing
    > Response.End
    >
    > I am calling this code from my image tag
    >

    Pete Wood Guest

  4. #4

    Default Re: Display Image Binary data in Web Browser

    Quote Originally Posted by Keenan Newton View Post
    One way to do is is mage the img src point to an ASPX page that outouts
    the binary. Does this answer your question?
    can u explain me in detail
    heerasharma007 Guest

Similar Threads

  1. Display BInary TIF file from database?
    By Scooby Doobie Doo in forum Coldfusion Server Administration
    Replies: 1
    Last Post: June 14th, 09:18 PM
  2. Replies: 2
    Last Post: December 6th, 08:45 PM
  3. How to convert JPEG image into a binary data?
    By Lucas Cowald in forum ASP.NET Building Controls
    Replies: 9
    Last Post: October 19th, 05:25 AM
  4. I need to display a PDF from SQL Binary Field
    By Marcel LeBlanc in forum ASP Database
    Replies: 2
    Last Post: October 7th, 04:14 PM
  5. Secure binary files with ASP.NET and open PDF with Browser
    By rodrigo in forum ASP.NET Security
    Replies: 0
    Last Post: July 9th, 01:29 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139