• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 425
  • Last Modified:

EASY Response.ContentType = "image"?

I forgot what is the Content Type for all images: GIF, JPG/JPEG, PNG?
0
joshbm
Asked:
joshbm
  • 2
  • 2
1 Solution
 
joshbmAuthor Commented:
Also once I do Response.ContentType = "image" or whatever do I just response.write "image.gif" to make the image appear?
0
 
Göran AnderssonCommented:
The mime types for
gif: image/gif
jpg: image/jpeg
png: image/png

After setting the content type, you have to read the image file and write it out to the response.stream.
0
 
joshbmAuthor Commented:
Okay is there a tutorial anywhere on response.stream? (just added 10 more pts)
0
 
Göran AnderssonCommented:
You use Response.Write to add to the response stream.

Just open the image file, then use the ReadAll method to read the file into a string. Then write the string using Response.Write.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now