Solved

EASY Response.ContentType = "image"?

Posted on 2002-07-26
4
413 Views
Last Modified: 2008-03-06
I forgot what is the Content Type for all images: GIF, JPG/JPEG, PNG?
0
Comment
Question by:joshbm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 2

Author Comment

by:joshbm
ID: 7181204
Also once I do Response.ContentType = "image" or whatever do I just response.write "image.gif" to make the image appear?
0
 
LVL 29

Expert Comment

by:Göran Andersson
ID: 7183366
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
 
LVL 2

Author Comment

by:joshbm
ID: 7183587
Okay is there a tutorial anywhere on response.stream? (just added 10 more pts)
0
 
LVL 29

Accepted Solution

by:
Göran Andersson earned 35 total points
ID: 7183610
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question