Solved

EASY Response.ContentType = "image"?

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error in query expression 3 56
If condition on Html with Asp 11 48
JS does not refresh 6 42
Html split(text) Part2 6 41
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/…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 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