Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Handler to write image from DB not working IE7

Handler to write image from DB not working IE7

Scheduled Pinned Locked Moved ASP.NET
questiondatabase
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eggsovereasy
    wrote on last edited by
    #1

    I have an .ashx file that loads an image (specified by id in querystring) and then writes it out to the client. This works perfectly in Firefox, but all I get is a red X in IE7 (I have no way to test IE6). Here is the method: public void ProcessRequest(HttpContext context) { int contribId = Convert.ToInt32(context.Request.QueryString["id"]); byte[] buffer = Contributor.GetImage(contribId); context.Response.ContentType = "image/jpeg"; context.Response.BinaryWrite(buffer); } Any idea what is wrong with this?

    T 1 Reply Last reply
    0
    • E eggsovereasy

      I have an .ashx file that loads an image (specified by id in querystring) and then writes it out to the client. This works perfectly in Firefox, but all I get is a red X in IE7 (I have no way to test IE6). Here is the method: public void ProcessRequest(HttpContext context) { int contribId = Convert.ToInt32(context.Request.QueryString["id"]); byte[] buffer = Contributor.GetImage(contribId); context.Response.ContentType = "image/jpeg"; context.Response.BinaryWrite(buffer); } Any idea what is wrong with this?

      T Offline
      T Offline
      ToddHileHoffer
      wrote on last edited by
      #2

      you could try public void ProcessRequest(HttpContext context) { int contribId = Convert.ToInt32(context.Request.QueryString["id"]); byte[] buffer = Contributor.GetImage(contribId); context.Response.ClearContent(); context.Response.ClearHeaders(); context.Response.ContentType = "image/jpeg"; context.Response.BinaryWrite(buffer); context.Response.End; }

      I didn't get any requirements for the signature

      E 1 Reply Last reply
      0
      • T ToddHileHoffer

        you could try public void ProcessRequest(HttpContext context) { int contribId = Convert.ToInt32(context.Request.QueryString["id"]); byte[] buffer = Contributor.GetImage(contribId); context.Response.ClearContent(); context.Response.ClearHeaders(); context.Response.ContentType = "image/jpeg"; context.Response.BinaryWrite(buffer); context.Response.End; }

        I didn't get any requirements for the signature

        E Offline
        E Offline
        eggsovereasy
        wrote on last edited by
        #3

        Ok, so come to discover that there was some issue with the image itself and Firefox could display it, but IE could not. Thanks for you suggestion though.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups