Difference between revisions of "Adding MIME Types"
From AgileApps Support Wiki
imported>Aeric |
imported>Aeric |
||
(11 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
When a Document or [[Static Resource]] is stored on the server, the appropriate {{^MIME}} type must be specified when the file is sent to the user's browser, so the browser knows what to do with that file. | <includeonly>===Adding MIME Types===</includeonly> | ||
When a Document or [[Static Resource]] is stored on the server, the appropriate {{^MIME}} type must be specified when the file is sent to the user's browser, so the browser knows what to do with that file. Normally, that process happens automatically: The most common file extensions are already recognized by the platform, and the file extension determines which MIME type is specified. | |||
When a file has an extension that the platform does not recognize, however, the file may be mishandled when it reaches the browser. That problem can be solved by adding a line to the server configuration file. | |||
In | '''In <tt>{apache-install-dir}/conf/httpd.conf</tt>, add:''' | ||
:{| | :{| | ||
<pre>AddType MIME_TYPE FILE_EXTENSION</pre> | <pre>AddType MIME_TYPE FILE_EXTENSION</pre> | ||
Line 14: | Line 13: | ||
<pre>AddType text/cache-manifest .appcache</pre> | <pre>AddType text/cache-manifest .appcache</pre> | ||
|} | |} | ||
<noinclude> | |||
[[Category:Installation]] | |||
</noinclude> |
Latest revision as of 11:56, 17 October 2019
When a Document or Static Resource is stored on the server, the appropriate MIME type must be specified when the file is sent to the user's browser, so the browser knows what to do with that file. Normally, that process happens automatically: The most common file extensions are already recognized by the platform, and the file extension determines which MIME type is specified.
When a file has an extension that the platform does not recognize, however, the file may be mishandled when it reaches the browser. That problem can be solved by adding a line to the server configuration file.
In {apache-install-dir}/conf/httpd.conf, add:
AddType MIME_TYPE FILE_EXTENSION
For example, to configure an HTML5 cache file with extension .appcache, add the following:
AddType text/cache-manifest .appcache