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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache - .pl CGI Scripts & IE File Save Dialog

Status
Not open for further replies.

anandxk

Programmer
Aug 14, 2002
9
US
Posted on Perl forum with no luck. Hope someone can help:

'lo folks. This has probably been asked before but I haven't found a complete explanation yet.

Running:
Win2K Pro SP3
Apache 1.3.26
ActivePerl 5.6.1

IE shows a File Save dialog when the CGI script has:
Content-type: text/plain
and the extension is .pl.
eg.
The unusual part is that the following URL :
does return the Environment Variables. Why does adding the / make a difference?

Thanks in advance.
 
It's because IE pays more attention to file extensions than it does to content-type headers.

In the first URL, IE knows it's going to be receiving a file with a .pl extension. IE doesn't know what to do with a file of that extension, so it reverts to its default behavior for files it doesn't know how to handle -- saving the file.

In the case of the second URL, IE is fooled into thinking that printenv.pl is a directory name. Since it doesn't know what the extension of the file is, it actually pays attention to the content-type header, and correctly displays the file.

There are a number of security advisories about this problem with IE. Enter the search term '"Internet explorer" HTTP "content-disposition"' into Google to see more. ______________________________________________________________________
TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top