DokuWiki

It's better when it's simple

User Tools

Site Tools


mime

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mime [2011-10-13 16:56]
– corrected incorrect mime type ach
mime [2022-05-08 07:22] (current)
– old revision restored (2022-01-29 23:51) oiv
Line 1: Line 1:
 ====== MIME configuration ====== ====== MIME configuration ======
  
-Which file types you can upload via the [[mediamanager]] is configured through the ''conf/mime.conf'' file. It also configures the file extension <-> mimetype association. +Which file types you can upload via the [[media manager|media manager popup]] or the [[fullscreen mediamanager|fullscreen media manager]] is configured through the ''[[https://github.com/splitbrain/dokuwiki/blob/master/conf/mime.conf|conf/mime.conf]]'' file. It also configures the file extension <-> mimetype association. 
  
 For security reasons it is not possible to configure [[DokuWiki]] to allow any file type. For security reasons it is not possible to configure [[DokuWiki]] to allow any file type.
Line 7: Line 7:
 :!: **Never enable HTML upload for unprotected wikis**, as this opens Cross Site Scripting vulnerabilities through JavaScript. Only enable this with trusted users. You need to disable the [[config:iexssprotect]] option additionally to adding the HTML mime type in the config file. :!: **Never enable HTML upload for unprotected wikis**, as this opens Cross Site Scripting vulnerabilities through JavaScript. Only enable this with trusted users. You need to disable the [[config:iexssprotect]] option additionally to adding the HTML mime type in the config file.
  
-Additional icons in a similar style are available at http://www.splitbrain.org/projects/file_icons+The icons are created with the [[https://github.com/splitbrain/file-icon-generator/blob/master/example-dokuwiki.php|file icon generator]]. Old additional icons in the old style are available at https://www.splitbrain.org/projects/file_icons 
 + 
 +You can find any file extension with its mime at https://filext.com/
  
 ===== Adding additional Mime Types ===== ===== Adding additional Mime Types =====
  
-Additional mimetypes should be added in ''mime.local.conf'' (you need to create this file). The file expects an extension (without the dot) and a mime type. Prefixing the mime type with an exclamation mark (!) will force the browser to present a download dialog, even if a browser plugin for the file in question exists.+Additional mimetypes should be added in ''mime.local.conf'' (you need to create this file). The file expects an extension (without the dot) and a mime type. Prefixing the mime type with an exclamation mark (''!'') will force the browser to present a download dialog, even if a browser plugin for the file in question exists.
  
 Example: Example:
  
-<code - mime.local.conf>+<code - conf/mime.local.conf>
 # this would play in the browser (if supported): # this would play in the browser (if supported):
 wav         audio/wav wav         audio/wav
Line 23: Line 25:
 </code> </code>
  
-File type icons can be added by placing an image file (PNG or GIF)((Icons must be 16x16.)) named after the file extension into ''lib/images/fileicons/''. Note: because the stylesheet used for assigning the fileicons gets [[caching|cached]] you need to force a rebuild by touching one of the config files.+Disable by mention the extension //without// a minetype. Disabling png-images by:<code - conf/mime.local.conf> 
 +png 
 +</code> 
 + 
 + 
 +For configuration changes to take effect on the pages, the [[devel:caching|cache must be purged]]. 
 + 
 +==== File type icons ==== 
 + 
 +File type icons can be added by placing an image file (SVG ([[devel:develonly]]), PNG((Icons must be 16x16.)) or GIF((Icons must be 16x16.))) named after the file extension into ''lib/images/fileicons/''. Note: because the stylesheet used for assigning the fileicons gets [[caching|cached]] you need to force a rebuild by touching one of the config files.
  
  
Line 30: Line 41:
 The default install contains the following configurations: The default install contains the following configurations:
  
-^Extension^Mime type                    ^ Icon ^ +^ Extension  ^ Mime type                                                                   ^ Icon                                                                      
-|jpg      |image/jpeg                   | {{http://www.dokuwiki.org/lib/images/fileicons/jpg.png?nolink&nocache}} | +| jpg        | image/jpeg                                                                  | {{http://www.dokuwiki.org/lib/images/fileicons/jpg.png?nocache&nolink}}   
-|jpeg     |image/jpeg                   | {{http://www.dokuwiki.org/lib/images/fileicons/jpeg.png?nolink&nocache}} | +| jpeg       | image/jpeg                                                                  | {{http://www.dokuwiki.org/lib/images/fileicons/jpeg.png?nocache&nolink}}  
-|gif      |image/gif                    | {{http://www.dokuwiki.org/lib/images/fileicons/gif.png?nolink&nocache}} | +| gif        | image/gif                                                                   | {{http://www.dokuwiki.org/lib/images/fileicons/gif.png?nocache&nolink}}   
-|png      |image/png                    | {{http://www.dokuwiki.org/lib/images/fileicons/png.png?nolink&nocache}} | +| png        | image/png                                                                   | {{http://www.dokuwiki.org/lib/images/fileicons/png.png?nocache&nolink}}   
-|swf      |application/x-shockwave-flash| {{http://www.dokuwiki.org/lib/images/fileicons/swf.png?nolink&nocache}} | +| swf        | application/x-shockwave-flash                                               | {{http://www.dokuwiki.org/lib/images/fileicons/swf.png?nocache&nolink}}   
-|mp3      |audio/mpeg                   | {{http://www.dokuwiki.org/lib/images/fileicons/mp3.png?nolink&nocache}} | +| mp3        | audio/mpeg                                                                  | {{http://www.dokuwiki.org/lib/images/fileicons/mp3.png?nocache&nolink}}   
-|ogg      |audio/ogg                    | {{http://www.dokuwiki.org/lib/images/fileicons/ogg.png?nolink&nocache}} | +| ogg        | audio/ogg                                                                   | {{http://www.dokuwiki.org/lib/images/fileicons/ogg.png?nocache&nolink}}   
-|wav      |audio/wav                    | {{http://www.dokuwiki.org/lib/images/fileicons/wav.png?nolink&nocache}} | +| wav        | audio/wav                                                                   | {{http://www.dokuwiki.org/lib/images/fileicons/wav.png?nocache&nolink}}   
-|tgz      |!application/octet-stream    | {{http://www.dokuwiki.org/lib/images/fileicons/tgz.png?nolink&nocache}} | +| tgz        | !application/octet-stream                                                   | {{http://www.dokuwiki.org/lib/images/fileicons/tgz.png?nocache&nolink}}   
-|tar      |!application/x-gtar          | {{http://www.dokuwiki.org/lib/images/fileicons/tar.png?nolink&nocache}} | +| tar        | !application/x-gtar                                                         | {{http://www.dokuwiki.org/lib/images/fileicons/tar.png?nocache&nolink}}   
-|gz       |!application/octet-stream    | {{http://www.dokuwiki.org/lib/images/fileicons/gz.png?nolink&nocache}} | +| gz         | !application/octet-stream                                                   | {{http://www.dokuwiki.org/lib/images/fileicons/gz.png?nocache&nolink}}    
-|bz2      |!application/octet-stream    | {{http://www.dokuwiki.org/lib/images/fileicons/bz2.png?nolink&nocache}} | +| bz2        | !application/octet-stream                                                   | {{http://www.dokuwiki.org/lib/images/fileicons/bz2.png?nocache&nolink}}   
-|zip      |!application/zip             | {{http://www.dokuwiki.org/lib/images/fileicons/zip.png?nolink&nocache}} | +| zip        | !application/zip                                                            | {{http://www.dokuwiki.org/lib/images/fileicons/zip.png?nocache&nolink}}   
-|rar      |!application/rar             | {{http://www.dokuwiki.org/lib/images/fileicons/rar.png?nolink&nocache}} | +| rar        | !application/rar                                                            | {{http://www.dokuwiki.org/lib/images/fileicons/rar.png?nocache&nolink}}   
-|7z       |!application/x-7z-compressed | {{http://www.dokuwiki.org/lib/images/fileicons/7z.png?nolink&nocache}} | +| 7z         | !application/x-7z-compressed                                                | {{http://www.dokuwiki.org/lib/images/fileicons/7z.png?nocache&nolink}}    
-|pdf      |application/pdf              | {{http://www.dokuwiki.org/lib/images/fileicons/pdf.png?nolink&nocache}} | +| pdf        | application/pdf                                                             | {{http://www.dokuwiki.org/lib/images/fileicons/pdf.png?nocache&nolink}}   
-|ps       |!application/postscript      | {{http://www.dokuwiki.org/lib/images/fileicons/ps.png?nolink&nocache}} | +| ps         | !application/postscript                                                     | {{http://www.dokuwiki.org/lib/images/fileicons/ps.png?nocache&nolink}}    
-|rpm      |!application/octet-stream    | {{http://www.dokuwiki.org/lib/images/fileicons/rpm.png?nolink&nocache}} | +| rpm        | !application/octet-stream                                                   | {{http://www.dokuwiki.org/lib/images/fileicons/rpm.png?nocache&nolink}}   
-|deb      |!application/octet-stream    | {{http://www.dokuwiki.org/lib/images/fileicons/deb.png?nolink&nocache}} | +| deb        | !application/octet-stream                                                   | {{http://www.dokuwiki.org/lib/images/fileicons/deb.png?nocache&nolink}}   
-|doc      |!application/msword          | {{http://www.dokuwiki.org/lib/images/fileicons/doc.png?nolink&nocache}} | +| doc        | !application/msword                                                         | {{http://www.dokuwiki.org/lib/images/fileicons/doc.png?nocache&nolink}}   
-|xls      |!application/msexcel         | {{http://www.dokuwiki.org/lib/images/fileicons/xls.png?nolink&nocache}} | +| xls        | !application/msexcel                                                        | {{http://www.dokuwiki.org/lib/images/fileicons/xls.png?nocache&nolink}}   
-|ppt      |!application/mspowerpoint    | {{http://www.dokuwiki.org/lib/images/fileicons/ppt.png?nolink&nocache}} | +| ppt        | !application/mspowerpoint                                                   | {{http://www.dokuwiki.org/lib/images/fileicons/ppt.png?nocache&nolink}}   
-|rtf      |!application/msword          | {{http://www.dokuwiki.org/lib/images/fileicons/rtf.png?nolink&nocache}} | +| rtf        | !application/msword                                                         | {{http://www.dokuwiki.org/lib/images/fileicons/rtf.png?nocache&nolink}}   
-|docx     |!application/vnd.openxmlformats-officedocument.wordprocessingml.document   | {{http://www.dokuwiki.org/lib/images/fileicons/docx.png?nolink&nocache}} | +| docx       | !application/vnd.openxmlformats-officedocument.wordprocessingml.document    | {{http://www.dokuwiki.org/lib/images/fileicons/docx.png?nocache&nolink}}  
-|xlsx     |!application/vnd.openxmlformats-officedocument.spreadsheetml.sheet         | {{http://www.dokuwiki.org/lib/images/fileicons/xlsx.png?nolink&nocache}} | +| xlsx       | !application/vnd.openxmlformats-officedocument.spreadsheetml.sheet          | {{http://www.dokuwiki.org/lib/images/fileicons/xlsx.png?nocache&nolink}}  
-|pptx     |!application/vnd.openxmlformats-officedocument.presentationml.presentation | {{http://www.dokuwiki.org/lib/images/fileicons/pptx.png?nolink&nocache}} | +| pptx       | !application/vnd.openxmlformats-officedocument.presentationml.presentation  | {{http://www.dokuwiki.org/lib/images/fileicons/pptx.png?nocache&nolink}}  
-|sxw      |!application/soffice         | {{http://www.dokuwiki.org/lib/images/fileicons/sxw.png?nolink&nocache}} | +| sxw        | !application/soffice                                                        | {{http://www.dokuwiki.org/lib/images/fileicons/sxw.png?nocache&nolink}}   
-|sxc      |!application/soffice         | {{http://www.dokuwiki.org/lib/images/fileicons/sxc.png?nolink&nocache}} | +| sxc        | !application/soffice                                                        | {{http://www.dokuwiki.org/lib/images/fileicons/sxc.png?nocache&nolink}}   
-|sxi      |!application/soffice         | {{http://www.dokuwiki.org/lib/images/fileicons/sxi.png?nolink&nocache}} | +| sxi        | !application/soffice                                                        | {{http://www.dokuwiki.org/lib/images/fileicons/sxi.png?nocache&nolink}}   
-|sxd      |!application/soffice         | {{http://www.dokuwiki.org/lib/images/fileicons/sxd.png?nolink&nocache}} | +| sxd        | !application/soffice                                                        | {{http://www.dokuwiki.org/lib/images/fileicons/sxd.png?nocache&nolink}}   
-|odc      |!application/vnd.oasis.opendocument.chart       | {{http://www.dokuwiki.org/lib/images/fileicons/odc.png?nolink&nocache}} | +| odc        | !application/vnd.oasis.opendocument.chart                                   | {{http://www.dokuwiki.org/lib/images/fileicons/odc.png?nocache&nolink}}   
-|odf      |!application/vnd.oasis.opendocument.formula     | {{http://www.dokuwiki.org/lib/images/fileicons/odf.png?nolink&nocache}} | +| odf        | !application/vnd.oasis.opendocument.formula                                 | {{http://www.dokuwiki.org/lib/images/fileicons/odf.png?nocache&nolink}}   
-|odg      |!application/vnd.oasis.opendocument.graphics    | {{http://www.dokuwiki.org/lib/images/fileicons/odg.png?nolink&nocache}} | +| odg        | !application/vnd.oasis.opendocument.graphics                                | {{http://www.dokuwiki.org/lib/images/fileicons/odg.png?nocache&nolink}}   
-|odi      |!application/vnd.oasis.opendocument.image       | {{http://www.dokuwiki.org/lib/images/fileicons/odi.png?nolink&nocache}} | +| odi        | !application/vnd.oasis.opendocument.image                                   | {{http://www.dokuwiki.org/lib/images/fileicons/odi.png?nocache&nolink}}   
-|odp      |!application/vnd.oasis.opendocument.presentation| {{http://www.dokuwiki.org/lib/images/fileicons/odp.png?nolink&nocache}}| +| odp        | !application/vnd.oasis.opendocument.presentation                            | {{http://www.dokuwiki.org/lib/images/fileicons/odp.png?nocache&nolink}}   
-|ods      |!application/vnd.oasis.opendocument.spreadsheet | {{http://www.dokuwiki.org/lib/images/fileicons/ods.png?nolink&nocache}}| +| ods        | !application/vnd.oasis.opendocument.spreadsheet                             | {{http://www.dokuwiki.org/lib/images/fileicons/ods.png?nocache&nolink}}   
-|odt      |!application/vnd.oasis.opendocument.text        | {{http://www.dokuwiki.org/lib/images/fileicons/odt.png?nolink&nocache}} |+| odt        | !application/vnd.oasis.opendocument.text                                    | {{http://www.dokuwiki.org/lib/images/fileicons/odt.png?nocache&nolink}}   |
  
 The following text types are commented by default, because spammers are known to upload spam pages through unprotected Wikis using text type files. The following text types are commented by default, because spammers are known to upload spam pages through unprotected Wikis using text type files.
  
-|html     |text/html                | {{http://www.dokuwiki.org/lib/images/fileicons/html.png?nolink&nocache}} | +| html  | text/html   | {{http://www.dokuwiki.org/lib/images/fileicons/html.png?nocache&nolink}}  
-|htm      |text/html                | {{http://www.dokuwiki.org/lib/images/fileicons/html.png?nolink&nocache}} | +| htm   | text/html   | {{http://www.dokuwiki.org/lib/images/fileicons/html.png?nocache&nolink}}  
-|txt      |text/plain               | {{http://www.dokuwiki.org/lib/images/fileicons/txt.png?nolink&nocache}} | +| txt   | text/plain  | {{http://www.dokuwiki.org/lib/images/fileicons/txt.png?nocache&nolink}}   
-|conf     |text/plain               | {{http://www.dokuwiki.org/lib/images/fileicons/conf.png?nolink&nocache}} | +| conf  | text/plain  | {{http://www.dokuwiki.org/lib/images/fileicons/conf.png?nocache&nolink}}  
-|xml      |text/xml                 | {{http://www.dokuwiki.org/lib/images/fileicons/xml.png?nolink&nocache}} | +| xml   | text/xml    | {{http://www.dokuwiki.org/lib/images/fileicons/xml.png?nocache&nolink}}   
-|csv      |text/csv                 | {{http://www.dokuwiki.org/lib/images/fileicons/csv.png?nolink&nocache}} |+| csv   | text/csv    | {{http://www.dokuwiki.org/lib/images/fileicons/csv.png?nocache&nolink}}   | 
  
  
 +=====See also=====
 +  * [[config|Configuring DokuWiki]]
mime.1318517789.txt.gz · Last modified: 2011-10-13 16:56 by ach

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki