Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSIE mime type problem 2

Status
Not open for further replies.

MMage

Programmer
Apr 29, 2002
15
US
Hi, I have I problem that I've quickly found out is anything but unique to me. I have have a CGI program written in Perl. It executes fine in netscape but not in IE. Though I know IE tries to save it instead of displaying because of the way it handles mime types, I haven't found an explaination of how to fix the problem. Any help in this matter would be appreciated.
 
you have set the mimetype in the header of the CGI ?

like :
Content-Type: text/html; charset=ISO-8859-1


--

Maurits

~ There is no place like 127.0.0.1 ~
 
Yes, I have it set as text/plain. It's actually the printenv.pl file that comes with apache. It works fine in Netscape, but not in MSIE.

What I'm really asking is is their anyway besides defining your own mime type to make MSIE handle the output correctly? For instance a text file that has html tags in it?

Here is a copy of the printenv.pl file:

#!c:/Perl/bin/Perl.exe
##
## printenv -- demo CGI program which just prints its environment
##

print "Content-type: text/plain\n\n";
foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print "${var}=\"${val}\"\n";
}


As you can see it's pretty simple.
 
A text file with html tags in it should be text/html.

When you test it from another computer does it show up the same ?


--

Maurits

~ There is no place like 127.0.0.1 ~
 
It seems that IE won't ever completely ignore file extensions.

I get the same behavior when pulling up a web script with a .pl extension. However, IE will display the output of the same script if that script has a .cgi extension.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
The .cgi trick worked. Thanx.

I think; however, I'm going to ask microsoft if there is a way to disable this behavior. If I make any progress I'll post a tip to this forum, because I know I'm not the only one who has had this problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top