Solved

EASY Response.ContentType = "image"?

Posted on 2002-07-26
4
394 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
  • 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now