Dokuwiki - Allow upload of different file extensions

By xngo on February 22, 2019

In Dokuwiki, if you try to upload a file and then you get the following message:

Upload denied. This file extension is forbidden!

You have to add the new extension in your mime configuration file, ./conf/mime.local.conf.

For example, if you want Dokuwiki to accept files with xlsm extension. Do the followings:

  1. Open ./conf/mime.local.conf. If it doesn't exist, create it.
  2. Add this line:xlsm    !application/vnd.ms-excel.sheet.macroEnabled.12. If there is an exclamation point(!) in front of the mine type, then it will force the browser to present the download dialog. Without an exclamation point(!), it will display the file on the browser.

Here is an example of mime.local.conf.

# Pick 1 option but not both.
 
# Option 1): This will open the file on the browser (if supported):
xlsm    application/vnd.ms-excel.sheet.macroEnabled.12
 
# Option 2): This will force a download.
xlsm    !application/vnd.ms-excel.sheet.macroEnabled.12

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.