469,644 Members | 1,929 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,644 developers. It's quick & easy.

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.OutputStream, 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
nj********@hotmail.com
http://www.nathansokalski.com/
Jul 29 '06 #1
3 1129

"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:e%****************@TK2MSFTNGP06.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.OutputStream, 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
Jul 29 '06 #2
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" <nj********@hotmail.comwrote in message
news:e%****************@TK2MSFTNGP06.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.OutputStream, 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
nj********@hotmail.com
http://www.nathansokalski.com/

Jul 30 '06 #3
Yes, I tried including the following line of code immediately before the
Save() method:

Response.ContentType="image/gif"

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

ContentType="image/gif"

But neither on seemed to make any difference.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Nick Malik [Microsoft]" <ni*******@hotmail.nospam.comwrote in message
news:L_******************************@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" <nj********@hotmail.comwrote in message
news:e%****************@TK2MSFTNGP06.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.OutputStream, 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
nj********@hotmail.com
http://www.nathansokalski.com/


Jul 30 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by andy_ro | last post: by
3 posts views Thread by Mats Boberg | last post: by
3 posts views Thread by Clay Black | last post: by
16 posts views Thread by Fred | last post: by
5 posts views Thread by TheGanjaMan | last post: by
9 posts views Thread by Jerry Spence1 | last post: by
3 posts views Thread by Nathan Sokalski | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.