Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

EASY Response.ContentType = "image"?

Posted on 2002-07-26
4
Medium Priority
?
423 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 140 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

604 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