Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Problem with Apache and CGI returning text/plain

From: rebol665:ifrance at: 10-May-2002 15:38

Hi me! I am replying to myself because I have found (at last) an explanation and a solution. "When everything else have failed, try to read the documentation !" Indeed I have found the answer in the Apache FAQ (see below). In brief, IE handles text/plain in a non standard way. The solution is to rename cgi-hw-txt.r to cgi-hw-txt.txt or cgi-hw-txt.cgi . Patrick Apache FAQ Why do my files appear correctly in Internet Explorer, but show up as source or trigger a save window with Netscape; or, Why doesn't Internet Explorer render my text/plain document correctly? MS Internet Explorer (MSIE) and Netscape handle mime type detection in different ways, and therefore will display the document differently. In particular, IE sometimes relies on the file extension or the contents of the file to determine the mime type. This can happen when the server specifies a mime type of application/octet-stream or text/plain. This behavior violates the the HTTP standard and makes it impossible to deliver plain text documents to MSIE clients in some cases. More details are available on MSIE's mime type detection behavior in an MSDN article (http://msdn.microsoft.com/workshop/networking/moniker/overview/appendix_a.a sp) and a note by Alan J. Flavell (http://ppewww.ph.gla.ac.uk/~flavell/www/content-type.html). The best you can do as a server administrator is to accurately configure the mime type of your documents by editing the mime.types file or using an AddType directive in the Apache configuration files. In some cases, you may be able to fool MSIE into rendering text/plain documents correctly by assuring they have a .txt filename extension, but this will not work if MSIE thinks the content looks like another file type. Patrick