473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 1302

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
3
by: andy_ro | last post by:
Hi group, I have an web application where the user can upload a pdf file. This file is stored in a table, in a column of type ntext. The user can later request the content of this column, and...
3
by: Mats Boberg | last post by:
Hi, I have problems with saving a bitmap to hdd from my asp.net page I get the following error: "A generic error occurred in GDI+." Code: Bitmap bmp = new Bitmap(240,120);
3
by: Clay Black | last post by:
I need to find a way to save an HTML page to the IIS server. What I need is to have a button that once it is clicked the current page being displayed is saved to a location on the local IIS...
16
by: Fred | last post by:
hi, is there some way to prevent(at least for not so advanced users) image saving on local disk; currently i use javascript which handles the right mouse button click, but all it takes is to...
5
by: TheGanjaMan | last post by:
Hi everyone, I'm trying to write up a simple image stamper application that stamps the Exif date information from the jpegs that I've taken from my digital camera and saves the new file with the...
9
by: Jerry Spence1 | last post by:
I have an http command such as http://<ip-Address>/getimage to get a jpg snapshot image from an IP camera. When I put this into a Web browser it shows the image OK. What I would like to go is to...
3
by: Nathan Sokalski | last post by:
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...
6
by: Mark Denardo | last post by:
My question is similar to one someone posted a few months back, but I don't see any replies. Basically I want to be able to have users upload photos and save them in a database (as byte data)...
13
by: =?Utf-8?B?emlyb3M=?= | last post by:
We have a need, after a user fill out a form, to save that page (aspx) and to send it as attachment by email , and to save it to a database for later retrieval any ideas how to save the aspx...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.