7 replies
by cactus pete
The server isn't causing this, the client interpretting the file is.
To force the client to see it as preformatted text, put
at the beginning of the file, and
at the end.
by slyip
by paulo.sedrez
Search the configuration file for mime_magic; you will find in two lines:
LoadModule mime_magic_module modules/mod_mime_magic.so
AddModule mod_mime_magic.c
Comment out this lines. Then search for the configuration clause, MIMEMagicFile:MIMEMagicFile conf/magic
or similar. Comment out this line. This will prevent identification of files based on its contents.
Now check the DefaultType. It should be 'text/plain'. Most systems change it to 'text/html' to make work bad CGI scripts.
If you want to be sure that .txt files are allways treated as text, you should use AddType:
AddType text/plain .txt
--Sedrez
by slyip
by shiva
Try viewing the file with different browsers. Internet Explorer will sometimes ignore a file's MIME type and interpret HTML markup. Mozilla and Opera are stricter in their interpretation of the data stream.
You can also use a tool like wget or even telnet to view the raw HTTP transaction and see whether the server is reporting the correct MIME type, which is ultimately what *should* be used to determine how to render the file.
by slyip
by slyip
This discussion is closed to new replies.
Trending Linux posts
Sort by Trending