Internet Explorer and ContentType="text/plain"

Posted on 2003-03-06
Medium Priority
Last Modified: 2013-11-19
I have created a number of .asp files setting the Response.ContentType property to a value of "text/plain".  However, when I attempt to view these pages in IE (6+) it attempts to download them as if they are suspicious file types, instead of displaying the text data to the screen.  I've been able to work around it fairly easily by immediately opening the file in Notepad, but it is becoming tiresome.  

Originally I thought it was a new "feature" in IE 6, but since have discovered that only IE 6 on my machine has this "feature".  Any suggestions?

Thanks in advance.
Question by:montyexchange
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
  • 3
  • 2
LVL 10

Expert Comment

ID: 8085696
try setting the content to text instead of text/plain.

alternatively, you can try setting it to:


normally, the x will qualify as "experimental", and you might be able to view it like that.

also, you could edit the files where the first line is "<pre>" and the last line is "</pre>" and then ignore the type or set it to "text/html"

if the first 2 don't work, the last one should.

Author Comment

ID: 8089477
Thanks for you input substand, but no dice on those suggestions.  I tried both the ="text" and ="text/x-something", neither of which displayed, both of which attempted to download.  

Some more info that might be helpful... The dialog box that pops up with info about the download says the following:
'Some files can harm your computer.  If the file information below looks suspicious, or you do not fully trust the source, do not open or save this file.

File name: monitor.asp
File type: ASP File
From: www....net

This type of file could harm your computer if it contains malicious code.

Would you like to open the file or save it to your computer?

Open | Save | Cancel | More Info'

LVL 10

Expert Comment

ID: 8090563
huh.  thats wierd.  can you put the <pre> tags in, or are you looking to not change the source code?

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 8104845

I'd rather not change the source code, but could if necessary.  Maybe I'll try that out.  I'm beginning to think that its some sort of conflict with other installed software (Visual Studio 6?).  

LVL 10

Expert Comment

ID: 8106343
well, i suppose, rather than changing the source, you could do a file like:

<!--- begin file --->
<include requestedfile so you don't have to change source code>
<!--- end file ---->

then link to that file, we'll call it showsource.asp like:

<a href="showsource.asp?file=realfilename.asp">realfilename</a>


Accepted Solution

Computer101 earned 0 total points
ID: 10464834
PAQed - no points refunded (of 50)

E-E Admin

Featured Post

CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

Question has a verified solution.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

762 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