473,378 Members | 1,346 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,378 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 1269

"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)...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.