Writing savable jpg

  • Thread starter Thread starter gb
  • Start date Start date
G

gb

I'm able to get a bitmap out of my database and write it to an aspx page and
this works easily. However, this cannot be saved as a jpg file as it is
simply an image written to a web page. Does anyone know how to make this
image savable as a jpg on the client?
G
 
| I'm able to get a bitmap out of my database and write it to an aspx page
and
| this works easily. However, this cannot be saved as a jpg file as it is
| simply an image written to a web page. Does anyone know how to make this
| image savable as a jpg on the client?

I don't fully understand what you mean - every "image written to a web page"
has some URL. But to have things correct, use the following:


Response.ContentType = "image/jpeg"
Response.AddHeader "Content-Disposition", "attachment; filename=myfile.jpg"
'-- your image writing code here
Response.End()
 
A web page doesn't have any images in it (It's just text). Images are linked
to, and must be downloaded to be seen in an HTML document. So, the image is
already saved as a file on the machine, in the Temporary Internet Files
folder, just like any other image. How on earth did you manage to get an
image out of a database and insert it into a web page ("easily?") without
knowing this?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.
 
Kevin:
Actually I didn't know it was saved in the Temporary Internet Files
directory. After again reverifying I am still sure that it is not written
to any place on the local computer. The code that does the write is as
follows:
myBigImage.Save(Response.OutputStream, ImageFormat.Jpeg)

Searches of all files in Documents and Settings shows no recent writes of
any file that could approximate this image.

Even if you were correct, the user of the web site would not know to go into
his temporary directory and hunt out the file and save it.

Fortunitely, Michal Valasek (message above) had a workable solution that
addresses my problem.

If you still think it is saved somewhere on the local system, please let me
know.
Thanks,

gb
 
Back
Top