Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 347
  • Last Modified:

Internet Explorer and ContentType="text/plain"

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.
0
montyexchange
Asked:
montyexchange
  • 3
  • 2
1 Solution
 
substandCommented:
try setting the content to text instead of text/plain.

alternatively, you can try setting it to:

text/x-something


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.
0
 
montyexchangeAuthor Commented:
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'

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

0
Technology Partners: 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!

 
montyexchangeAuthor Commented:
substand,

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?).  

Thanks.
0
 
substandCommented:
well, i suppose, rather than changing the source, you could do a file like:

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


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

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

0
 
Computer101Commented:
PAQed - no points refunded (of 50)

Computer101
E-E Admin
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now