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 [2020-05-14 14:42] – http -> https Aleksandrmime [2023-11-25 01:00] (current) – [See also] Klap-in
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 https://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 its mime at https://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 33: Line 47:
  
 ^ Extension  ^ Mime type                                                                   ^ Icon                                                                      ^ ^ Extension  ^ Mime type                                                                   ^ Icon                                                                      ^
-| jpg        | image/jpeg                                                                  | {{http://www.dokuwiki.org/lib/images/fileicons/jpg.png?nocache&nolink}}   | +| 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?nocache&nolink}}  | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}    | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}    | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}    | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}} +| 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?nocache&nolink}} +| 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?nocache&nolink}} +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   |+| 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?nocache&nolink}} +| 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?nocache&nolink}} +| 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?nocache&nolink}}   | +| 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?nocache&nolink}} +| 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?nocache&nolink}}   | +| 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?nocache&nolink}}   |+| 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}}]][[plugin:confmanager|Configuration File Manager]] for editing via admin interface of the wiki
mime.1589460126.txt.gz · Last modified: 2020-05-14 14:42 by Aleksandr

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