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 [2015-09-18 11:44] – 0 202.181.239.184mime [2024-11-03 07:04] (current) Aleksandr
Line 1: Line 1:
 ====== MIME configuration ====== ====== MIME configuration ======
  
-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. +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/dokuwiki/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.
  
-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 http://www.splitbrain.org/projects/file_icons+You can find any file extension with its mime at https://filext.com/, these are used since the Igor 2022 release.
  
-You can find any file extension with it's mime at http://filext.com/+For Hogfather 2020 release and older, the icons were 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
  
 ===== 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 25: 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 mimetype. 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 SVG file named after the file extension into ''lib/images/fileicons/svg/''. 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 or just save the [[plugin:config|Configuration Manager]] another time.  
 + 
 +Since Igor 2022 release //only// SVG icons are automatically recognized. See also this forum post about a [[https://forum.dokuwiki.org/d/20377/4|workaround]]. 
 + 
 +From Hogfather 2020 and older //only// PNG((Icons must be 16x16.)) or GIF((Icons must be 16x16.)) are automatically recognized in the folder ''lib/images/fileicons/''. 
  
  
Line 32: Line 46:
 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                                                                  | {{https://www.dokuwiki.org/lib/images/fileicons/svg/jpg.svg?nolink&16}}   
-|jpeg     |image/jpeg                   | {{http://www.dokuwiki.org/lib/images/fileicons/jpeg.png?nolink&nocache}} | +| jpeg       | image/jpeg                                                                  | {{https://www.dokuwiki.org/lib/images/fileicons/svg/jpeg.svg?nolink&16}}  
-|gif      |image/gif                    | {{http://www.dokuwiki.org/lib/images/fileicons/gif.png?nolink&nocache}} | +| gif        | image/gif                                                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/gif.svg?nolink&16}}   
-|png      |image/png                    | {{http://www.dokuwiki.org/lib/images/fileicons/png.png?nolink&nocache}} | +| png        | image/png                                                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/png.svg?nolink&16}}   
-|swf      |application/x-shockwave-flash| {{http://www.dokuwiki.org/lib/images/fileicons/swf.png?nolink&nocache}} | +webp        image/webp                                                                 | {{https://www.dokuwiki.org/lib/images/fileicons/svg/webp.svg?nolink&16}} FIXME  | 
-|mp3      |audio/mpeg                   | {{http://www.dokuwiki.org/lib/images/fileicons/mp3.png?nolink&nocache}} | +| ico        | image/vnd.microsoft.icon                                                                  | {{https://www.dokuwiki.org/lib/images/fileicons/svg/ico.svg?nolink&16}}   | 
-|ogg      |audio/ogg                    | {{http://www.dokuwiki.org/lib/images/fileicons/ogg.png?nolink&nocache}} | +| svg        | image/svg+xml                                              | {{https://www.dokuwiki.org/lib/images/fileicons/svg/svg.svg?nolink&16}}   
-|wav      |audio/wav                    | {{http://www.dokuwiki.org/lib/images/fileicons/wav.png?nolink&nocache}} | +| mp3        | audio/mpeg                                                                  | {{https://www.dokuwiki.org/lib/images/fileicons/svg/mp3.svg?nolink&16}}   
-|tgz      |!application/octet-stream    | {{http://www.dokuwiki.org/lib/images/fileicons/tgz.png?nolink&nocache}} | +| ogg        | audio/ogg                                                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/ogg.svg?16&nolink}}   
-|tar      |!application/x-gtar          | {{http://www.dokuwiki.org/lib/images/fileicons/tar.png?nolink&nocache}} | +| wav        | audio/wav                                                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/wav.svg?16&nolink}}   | 
-|gz       |!application/octet-stream    | {{http://www.dokuwiki.org/lib/images/fileicons/gz.png?nolink&nocache}} | +| webm        | video/webm                                                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/webm.svg?16&nolink}}   | 
-|bz2      |!application/octet-stream    | {{http://www.dokuwiki.org/lib/images/fileicons/bz2.png?nolink&nocache}} | +| ogv        | video/ogg                                                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/ogv.svg?16&nolink}}   | 
-|zip      |!application/zip             | {{http://www.dokuwiki.org/lib/images/fileicons/zip.png?nolink&nocache}} | +| mp4        | video/mp4                                                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/mp4.svg?16&nolink}}   | 
-|rar      |!application/rar             | {{http://www.dokuwiki.org/lib/images/fileicons/rar.png?nolink&nocache}} | +| vtt        | text/vtt                                                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/vtt.svg?svg&nolink}} FIXME  
-|7z       |!application/x-7z-compressed | {{http://www.dokuwiki.org/lib/images/fileicons/7z.png?nolink&nocache}} | +| tgz        | !application/octet-stream                                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/tgz.svg?16&nolink}}   
-|pdf      |application/pdf              | {{http://www.dokuwiki.org/lib/images/fileicons/pdf.png?nolink&nocache}} | +| tar        | !application/x-gtar                                                         | {{https://www.dokuwiki.org/lib/images/fileicons/svg/tar.svg?16&nolink}}   
-|ps       |!application/postscript      | {{http://www.dokuwiki.org/lib/images/fileicons/ps.png?nolink&nocache}} | +| gz         | !application/octet-stream                                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/gz.svg?16&nolink}}    
-|rpm      |!application/octet-stream    | {{http://www.dokuwiki.org/lib/images/fileicons/rpm.png?nolink&nocache}} | +| bz2        | !application/octet-stream                                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/bz2.svg?16&nolink}}   
-|deb      |!application/octet-stream    | {{http://www.dokuwiki.org/lib/images/fileicons/deb.png?nolink&nocache}} | +| zip        | !application/zip                                                            | {{https://www.dokuwiki.org/lib/images/fileicons/svg/zip.svg?16&nolink}}   
-|doc      |!application/msword          | {{http://www.dokuwiki.org/lib/images/fileicons/doc.png?nolink&nocache}} | +| rar        | !application/rar                                                            | {{https://www.dokuwiki.org/lib/images/fileicons/svg/rar.svg?16&nolink}}   
-|xls      |!application/msexcel         | {{http://www.dokuwiki.org/lib/images/fileicons/xls.png?nolink&nocache}} | +| 7z         | !application/x-7z-compressed                                                | {{https://www.dokuwiki.org/lib/images/fileicons/svg/7z.svg?16&nolink}}    
-|ppt      |!application/mspowerpoint    | {{http://www.dokuwiki.org/lib/images/fileicons/ppt.png?nolink&nocache}} | +| pdf        | application/pdf                                                             | {{https://www.dokuwiki.org/lib/images/fileicons/svg/pdf.svg?16&nolink}}   
-|rtf      |!application/msword          | {{http://www.dokuwiki.org/lib/images/fileicons/rtf.png?nolink&nocache}} | +| ps         | !application/postscript                                                     | {{https://www.dokuwiki.org/lib/images/fileicons/svg/ps.svg?16&nolink}}    
-|docx     |!application/vnd.openxmlformats-officedocument.wordprocessingml.document   | {{http://www.dokuwiki.org/lib/images/fileicons/docx.png?nolink&nocache}} | +| rpm        | !application/octet-stream                                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/rpm.svg?16&nolink}}   
-|xlsx     |!application/vnd.openxmlformats-officedocument.spreadsheetml.sheet         | {{http://www.dokuwiki.org/lib/images/fileicons/xlsx.png?nolink&nocache}} | +| deb        | !application/octet-stream                                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/deb.svg?16&nolink}}   
-|pptx     |!application/vnd.openxmlformats-officedocument.presentationml.presentation | {{http://www.dokuwiki.org/lib/images/fileicons/pptx.png?nolink&nocache}} | +| doc        | !application/msword                                                         | {{https://www.dokuwiki.org/lib/images/fileicons/svg/doc.svg?16&nolink}}   
-|sxw      |!application/soffice         | {{http://www.dokuwiki.org/lib/images/fileicons/sxw.png?nolink&nocache}} | +| xls        | !application/msexcel                                                        | {{https://www.dokuwiki.org/lib/images/fileicons/svg/xls.svg?16&nolink}}   
-|sxc      |!application/soffice         | {{http://www.dokuwiki.org/lib/images/fileicons/sxc.png?nolink&nocache}} | +| ppt        | !application/mspowerpoint                                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/ppt.svg?16&nolink}}   
-|sxi      |!application/soffice         | {{http://www.dokuwiki.org/lib/images/fileicons/sxi.png?nolink&nocache}} | +| rtf        | !application/msword                                                         | {{https://www.dokuwiki.org/lib/images/fileicons/svg/rtf.svg?16&nolink}}   
-|sxd      |!application/soffice         | {{http://www.dokuwiki.org/lib/images/fileicons/sxd.png?nolink&nocache}} | +| docx       | !application/vnd.openxmlformats-officedocument.wordprocessingml.document    | {{https://www.dokuwiki.org/lib/images/fileicons/svg/docx.svg?16&nolink}}  
-|odc      |!application/vnd.oasis.opendocument.chart       | {{http://www.dokuwiki.org/lib/images/fileicons/odc.png?nolink&nocache}} | +| xlsx       | !application/vnd.openxmlformats-officedocument.spreadsheetml.sheet          | {{https://www.dokuwiki.org/lib/images/fileicons/svg/xlsx.svg?16&nolink}}  
-|odf      |!application/vnd.oasis.opendocument.formula     | {{http://www.dokuwiki.org/lib/images/fileicons/odf.png?nolink&nocache}} | +| pptx       | !application/vnd.openxmlformats-officedocument.presentationml.presentation  | {{https://www.dokuwiki.org/lib/images/fileicons/svg/pptx.svg?16&nolink}}  
-|odg      |!application/vnd.oasis.opendocument.graphics    | {{http://www.dokuwiki.org/lib/images/fileicons/odg.png?nolink&nocache}} | +| sxw        | !application/soffice                                                        | {{https://www.dokuwiki.org/lib/images/fileicons/svg/sxw.svg?16&nolink}}   
-|odi      |!application/vnd.oasis.opendocument.image       | {{http://www.dokuwiki.org/lib/images/fileicons/odi.png?nolink&nocache}} | +| sxc        | !application/soffice                                                        | {{https://www.dokuwiki.org/lib/images/fileicons/svg/sxc.svg?16&nolink}}   
-|odp      |!application/vnd.oasis.opendocument.presentation| {{http://www.dokuwiki.org/lib/images/fileicons/odp.png?nolink&nocache}}| +| sxi        | !application/soffice                                                        | {{https://www.dokuwiki.org/lib/images/fileicons/svg/sxi.svg?16&nolink}}   
-|ods      |!application/vnd.oasis.opendocument.spreadsheet | {{http://www.dokuwiki.org/lib/images/fileicons/ods.png?nolink&nocache}}| +| sxd        | !application/soffice                                                        | {{https://www.dokuwiki.org/lib/images/fileicons/svg/sxd.svg?16&nolink}}   
-|odt      |!application/vnd.oasis.opendocument.text        | {{http://www.dokuwiki.org/lib/images/fileicons/odt.png?nolink&nocache}} |+| odc        | !application/vnd.oasis.opendocument.chart                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/odc.svg?16&nolink}}   
 +| odf        | !application/vnd.oasis.opendocument.formula                                 | {{https://www.dokuwiki.org/lib/images/fileicons/svg/odf.svg?16&nolink}}   
 +| odg        | !application/vnd.oasis.opendocument.graphics                                | {{https://www.dokuwiki.org/lib/images/fileicons/svg/odg.svg?16&nolink}}   
 +| odi        | !application/vnd.oasis.opendocument.image                                   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/odi.svg?16&nolink}}   
 +| odp        | !application/vnd.oasis.opendocument.presentation                            | {{https://www.dokuwiki.org/lib/images/fileicons/svg/odp.svg?16&nolink}}   
 +| ods        | !application/vnd.oasis.opendocument.spreadsheet                             | {{https://www.dokuwiki.org/lib/images/fileicons/svg/ods.svg?16&nolink}}   
 +| odt        | !application/vnd.oasis.opendocument.text                                    | {{https://www.dokuwiki.org/lib/images/fileicons/svg/odt.svg?16&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   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/html.svg?16&nolink}}  
-|htm      |text/html                | {{http://www.dokuwiki.org/lib/images/fileicons/html.png?nolink&nocache}} | +| htm   | text/html   | {{https://www.dokuwiki.org/lib/images/fileicons/svg/html.svg?16&nolink}}  
-|txt      |text/plain               | {{http://www.dokuwiki.org/lib/images/fileicons/txt.png?nolink&nocache}} | +| txt   | text/plain  | {{https://www.dokuwiki.org/lib/images/fileicons/svg/txt.svg?16&nolink}}   
-|conf     |text/plain               | {{http://www.dokuwiki.org/lib/images/fileicons/conf.png?nolink&nocache}} | +| conf  | text/plain  | {{https://www.dokuwiki.org/lib/images/fileicons/svg/conf.svg?16&nolink}}  
-|xml      |text/xml                 | {{http://www.dokuwiki.org/lib/images/fileicons/xml.png?nolink&nocache}} | +| xml   | text/xml    | {{https://www.dokuwiki.org/lib/images/fileicons/svg/xml.svg?16&nolink}}   
-|csv      |text/csv                 | {{http://www.dokuwiki.org/lib/images/fileicons/csv.png?nolink&nocache}} |+| csv   | text/csv    | {{https://www.dokuwiki.org/lib/images/fileicons/svg/csv.svg?16&nolink}}   |
  
  
Line 84: Line 104:
 =====See also===== =====See also=====
   * [[config|Configuring DokuWiki]]   * [[config|Configuring DokuWiki]]
 +  * You can install and use the [[plugin:confmanager|{{https://raw.githubusercontent.com/cosmocode/confmanager/master/admin.svg?16&recache}}]][[plugin:confmanager|Configuration File Manager]] for editing via admin interface of the wiki
mime.1442569463.txt.gz · Last modified: 2015-09-18 11:44 by 202.181.239.184

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