From 5346a7df024cabddf251174ad0c04b667e715ffe Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 21 Jul 2009 17:31:09 +0000 Subject: Allow content types to be configured in ejabberd.cfg (EJAB-975)(thanks to Brian Cully) SVN Revision: 2376 --- doc/guide.html | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'doc/guide.html') diff --git a/doc/guide.html b/doc/guide.html index 2d1fb8eaa..13e104e96 100644 --- a/doc/guide.html +++ b/doc/guide.html @@ -2111,17 +2111,32 @@ Indicate one or more directory index files, similarly to Apache’s DirectoryIndex variable. When a web request hits a directory instead of a regular file, those directory indices are looked in order, and the first one found is returned. +
content_types
+Specify a mapping of extensions to content types. +There are several content types already defined, +with this option you can add new definitions, modify or delete existing ones. +To delete an existing definition, simply define it with a value: ‘undefined’. +
default_content_type
+Specify the content type to use for unknown extensions. +Default value is ‘application/octet-stream’.

This example configuration will serve the files from the local directory /var/www in the address http://example.org:5280/pub/archive/. +In this example a new content type ogg is defined, +png is redefined, and jpg definition is deleted. To use this module you must enable it:

{modules,
  [
   ...
   {mod_http_fileserver, [
                          {docroot, "/var/www"}, 
-    {directory_indices, ["index.html", "main.htm"]},
-                         {accesslog, "/var/log/ejabberd/access.log"}
+                         {accesslog, "/var/log/ejabberd/access.log"},
+                         {directory_indices, ["index.html", "main.htm"]},
+                         {content_types, [{".ogg", "audio/ogg"},
+                                          {".png", "image/png"},
+                                          {".jpg", undefined}
+                                         ]},
+                         {default_content_type, "text/html"}
                         ]
   },
   ...
-- 
cgit v1.2.3