Topic on Project:Support desk

Trying to upload a doc file gives error: "Cannot upload this file because Internet Explorer would detect it as "application/msword", which is a disallowed and potentially dangerous file type."

5
Nkq (talkcontribs)

Using v 1.17.0. Have successfully uploaded doc files in earlier version of mediawiki, upgraded without changing any settings and now is not working.

Any clues what can be wrong?

Rgs,

/N

ReadersDigestUK (talkcontribs)

The problem is that the mime type for Word Documents is in the "Blacklisted mime types" by default

If its just Word documents you want to allow, then add the following to your LocalSettings.php . If there is anything else you want to allow, just remove it from the array :

$wgMimeTypeBlacklist = array ( "text/html", "text/javascript", "text/x-javascript", "application/x-shellscript", "application/x-php", "text/x-php", "text/x-python", "text/x-perl", "text/x-bash", "text/x-sh", "text/x-csh", "text/scriptlet", "application/x-msdownload", "application/x-msmetafile", "application/x-opc+zip", "application/vnd.ms-powerpoint", "application/vnd.msexcel" );

  1. The $wgMimeTypeBlacklist is the same as defined by default, except I removed
  2. "application/msword" to allow word docs
Ron Barker (talkcontribs)

Many thanks. I can now upload docx files. All I need to do now is work out how to open word docx files in the browser. I can work round this by doing what I used to do with pdf files, and that is click on properties and copy the url in there. Once again many thanks.

Bawolff (talkcontribs)

Just as a note, MS word documents can be dangerous to upload due to the faking-it-as-a-java-applet vulnerability (could allow someone to do evil things to your wiki), which is why they're on the blacklist. In 1.18 we started scanning such files for such issues better, so as of 1.18 MS word files are no longer blacklisted.

Ron Barker (talkcontribs)

Many thanks, I would love to upgrade if I could, but it is far too complicated for me to do that. The explanations on here and elsewhere pre-supposes that anyone wishing to upgrade know all about MediaWiki and php. I don't. I did manage to download and install MediaWiki and Wamp onto my pc, but I had nothing to loose if anything went wrong. The difference now is that by attempting to upgrade I could loose my wiki, and I cannot contemplate that,

Kind regards and thank you for the warning.

Reply to "Trying to upload a doc file gives error: "Cannot upload this file because Internet Explorer would detect it as "application/msword", which is a disallowed and potentially dangerous file type.""