Saving an image from the browser

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nathan Sokalski

    #1

    Saving an image from the browser

    I am using ASP.NET, VB.NET, and GDI+ to dynamically create images for
    webpages. When I right-click on the dynamically created image to try to save
    it to my hard drive, which I send as ImageFormat.Gif , my browser (Internet
    Explorer 6.0) wants me to save it as a *.bmp file. The VB.NET line of code
    that I use to send the image to the browser is:

    textbitmap.Save (Response.Outpu tStream, ImageFormat.Gif )

    Why is my browser forcing me to save an image (supposedly) sent as a gif as
    a bmp? Is there some other line of code I need to add in order for IE6 to
    recognize it as a *.gif file, or is this just a bug in IE6? (Yes, I know
    that I can use the Save() method to save it as a file on my computer, but I
    want the browser to treat the dynamically generated images the same as other
    images, including the ability to download them in the intended format)
    --
    Nathan Sokalski
    njsokalski@hotm ail.com
    有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。



  • Jaap Bos

    #2
    Re: Saving an image from the browser


    "Nathan Sokalski" <njsokalski@hot mail.comschreef in bericht
    news:e%23cQmq1s GHA.1304@TK2MSF TNGP06.phx.gbl. ..
    >I am using ASP.NET, VB.NET, and GDI+ to dynamically create images for
    >webpages. When I right-click on the dynamically created image to try to
    >save it to my hard drive, which I send as ImageFormat.Gif , my browser
    >(Internet Explorer 6.0) wants me to save it as a *.bmp file. The VB.NET
    >line of code that I use to send the image to the browser is:
    >
    textbitmap.Save (Response.Outpu tStream, ImageFormat.Gif )
    >
    Why is my browser forcing me to save an image (supposedly) sent as a gif
    as a bmp? Is there some other line of code I need to add in order for IE6
    to recognize it as a *.gif file, or is this just a bug in IE6?
    A bug in IE6. Deleting your temp. internetfiles is a know remedy.

    Jaap


    Comment

    • Nick Malik [Microsoft]

      #3
      Re: Saving an image from the browser

      Does your HTTP Response header list the data type as GIF?

      --
      --- Nick Malik [Microsoft]
      MCSD, CFPS, Certified Scrummaster
      http://blogs.msdn.com/nickmalik

      Disclaimer: Opinions expressed in this forum are my own, and not
      representative of my employer.
      I do not answer questions on behalf of my employer. I'm just a
      programmer helping programmers.
      --
      "Nathan Sokalski" <njsokalski@hot mail.comwrote in message
      news:e%23cQmq1s GHA.1304@TK2MSF TNGP06.phx.gbl. ..
      >I am using ASP.NET, VB.NET, and GDI+ to dynamically create images for
      >webpages. When I right-click on the dynamically created image to try to
      >save it to my hard drive, which I send as ImageFormat.Gif , my browser
      >(Internet Explorer 6.0) wants me to save it as a *.bmp file. The VB.NET
      >line of code that I use to send the image to the browser is:
      >
      textbitmap.Save (Response.Outpu tStream, ImageFormat.Gif )
      >
      Why is my browser forcing me to save an image (supposedly) sent as a gif
      as a bmp? Is there some other line of code I need to add in order for IE6
      to recognize it as a *.gif file, or is this just a bug in IE6? (Yes, I
      know that I can use the Save() method to save it as a file on my computer,
      but I want the browser to treat the dynamically generated images the same
      as other images, including the ability to download them in the intended
      format)
      --
      Nathan Sokalski
      njsokalski@hotm ail.com
      有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。

      >

      Comment

      • Nathan Sokalski

        #4
        Re: Saving an image from the browser

        Yes, I tried including the following line of code immediately before the
        Save() method:

        Response.Conten tType="image/gif"

        I also have the following attribute in my @Page directive:

        ContentType="im age/gif"

        But neither on seemed to make any difference.
        --
        Nathan Sokalski
        njsokalski@hotm ail.com
        有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。


        "Nick Malik [Microsoft]" <nickmalik@hotm ail.nospam.comw rote in message
        news:L_KdnTGatc OAx1HZnZ2dnUVZ_ tKdnZ2d@comcast .com...
        Does your HTTP Response header list the data type as GIF?
        >
        --
        --- Nick Malik [Microsoft]
        MCSD, CFPS, Certified Scrummaster
        http://blogs.msdn.com/nickmalik
        >
        Disclaimer: Opinions expressed in this forum are my own, and not
        representative of my employer.
        I do not answer questions on behalf of my employer. I'm just a
        programmer helping programmers.
        --
        "Nathan Sokalski" <njsokalski@hot mail.comwrote in message
        news:e%23cQmq1s GHA.1304@TK2MSF TNGP06.phx.gbl. ..
        >>I am using ASP.NET, VB.NET, and GDI+ to dynamically create images for
        >>webpages. When I right-click on the dynamically created image to try to
        >>save it to my hard drive, which I send as ImageFormat.Gif , my browser
        >>(Internet Explorer 6.0) wants me to save it as a *.bmp file. The VB.NET
        >>line of code that I use to send the image to the browser is:
        >>
        >textbitmap.Sav e(Response.Outp utStream, ImageFormat.Gif )
        >>
        >Why is my browser forcing me to save an image (supposedly) sent as a gif
        >as a bmp? Is there some other line of code I need to add in order for IE6
        >to recognize it as a *.gif file, or is this just a bug in IE6? (Yes, I
        >know that I can use the Save() method to save it as a file on my
        >computer, but I want the browser to treat the dynamically generated
        >images the same as other images, including the ability to download them
        >in the intended format)
        >--
        >Nathan Sokalski
        >njsokalski@hotm ail.com
        >http://www.nathansokalski.com/
        >>
        >
        >

        Comment

        Working...