Writing savable jpg

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
 
M

Michal A. Valasek

| 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()
 
K

Kevin Spencer

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.
 
T

Tina

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top