MIME types

From MozillaZine Knowledge Base

(Difference between revisions)
Revision as of 17:09, 19 February 2007
Np (Talk | contribs)
(Configuring MIME types - previous url is 404, this may not be best but it's something)
<-- Previous diff
Revision as of 21:14, 23 May 2007
Np (Talk | contribs)
(merged into devmo article)
Next diff -->
Line 1: Line 1:
-MIME types (content types) tell the browser what to do with content sent to it.+See [ Properly Configuring Server MIME Types] at [ MDC].
-== Common MIME types ==+[[Category:Redirects]]
-! MIME Type+
-! Result+
-|Display as plain text+
-|Render as HTML+
-== Results of sending as the wrong type ==+
- +
-Sending the wrong MIME type can result in a file being downloaded instead of displayed, displayed instead of downloaded, or displayed improperly. You can see what MIME type your server is sending by using "Tools -> Page Info" in Firefox ("View -> Page Info" in Mozilla Suite) or you can use the [ Live HTTP Headers extension]. Internet Explorer uses non-standard and insecure "sniffing" to sometimes override what the server tells it, so the oversight is not always apparent at first.+
- +
-== Configuring MIME types ==+
-*[ MIME Types in IIS]+
-*[ Apache MIME Types]+
- +
-== Server-side scripts ==+
-If you are using a server-side scripting language to generate content, the appropriate [ content-type] response header must be sent as well as the content itself. How this is accomplished depends on what language is being used. The following is an example using [ Perl]:+
- +
-<pre>print "Content-Type: text/html; charset=utf-8\n\n";+
-print "<html>\n";+
-print "<head>\n";+
-print "<title>Hello World!</title>\n";+
-print "</head>\n";+
-print "<body>\n";+
-print "<p>Hello World!</p>\n";+
-print "</body>\n";+
-print "</html>\n";</pre>+
- +
-The first line of the above Perl script will identify the content as text/html and the browser will render it as such. Refer to the documentation of your scripting language for information about sending the appropriate content-type.+
- +
-==Related links==+
-* [ How Mozilla determines MIME Types] +
-* [ Properly Configuring Server MIME Types]+
-* [ Checking HTTP Headers]+
-* [ The HTTP content-type/charset parameter]+
-* [ MIME Type list and related plugins - PluginDoc]+
- +

Revision as of 21:14, 23 May 2007

See Properly Configuring Server MIME Types at MDC.