Topic on Project:Support desk

uploading doc files not "allowed" but doc is an allowed extension.. help?

2
Exsnafu (talkcontribs)

mediaWiki v1.17.0 PHP 5.3.3 MySQL 5.0.77

wiki URL is not public accessable unfortunately.

relavent piece of LocalSettings.php:

$wgStrictFileExtensions = false; # i've tried setting this or not with same result.
$wgFileExtensions = array('png', 'gif', 'doc', 'docx', 'xls', 'xlsx', 'pdf', 'ppt', 'pptx', 'vsd', 'mpp', 'jpg', 'png');

$wgEnableUploads = true; # Enable uploads

now, I've also updated the includes/mime.types file to associate docx, pptx etc with the appropriate file type.

however, when I go to upload a .doc file I get: Files of the MIME type "application/msword" are not allowed to be uploaded.

When I go to upload a docx file I get: Files of the MIME type "application/x-opc+zip" are not allowed to be uploaded.

pdf and xls files are allowed to be uploaded..

I started a debug file but I don't really get anything useful out of it, for doc files it simply reports that it was able to identify that mime type.. log output:

User: loading options for user 2 from override cache.
Connecting to 10.4.128.58 eoswiki...
Connected to 10.4.128.58 eoswiki.
MessageCache::load: Loading en... got from global cache
User::isBlocked: enter
User::getBlockedStatus: checking...
IP: 10.128.1.142
Block::load: '10.128.1.142', '2', 1
File::getPropsFromPath: Getting file info for /tmp/phpI0xI27
MimeMagic::__construct: loading mime types from /var/www/html/mediawiki-1.17.0/includes/mime.types
MimeMagic::__construct: loading mime info from /var/www/html/mediawiki-1.17.0/includes/mime.info
MimeMagic::doGuessMimeType: analyzing head and tail of /tmp/phpI0xI27 for magic numbers.
MimeMagic::doGuessMimeType: ZIP header present in /tmp/phpI0xI27
MimeMagic::detectZipType: detected a MS Office document with OPC trailer
MimeMagic::guessMimeType: guessed mime type of /tmp/phpI0xI27: application/msword
MimeMagic::improveTypeFromExtension: improved mime type for .doc: application/msword
MediaHandler::getHandler: no handler found for application/msword.
File::getPropsFromPath: /tmp/phpI0xI27 loaded, 50688 bytes, application/msword.
MacBinary::loadHeader: header bytes 0 and 74 not null


mime: <application/msword> extension: <doc>

UploadBase::verifyExtension: mime type application/msword matches extension doc, passing file
Class SkinVector not found; skipped loading
Title::getRestrictionTypes: applicable restriction types for Special:Upload are createDatabaseBase::query: Writes done: DELETE FROM `eosobjectcache` WHERE (exptime < '20110922173834')
OutputPage::sendCacheControl: private caching;  **
Request ended normally
Exsnafu (talkcontribs)

resolved this I think correctly by adding wgMimeTypeBlacklist to my LocalSettings.php without the msword, opc/zip mime types listed..

I understand the security implications.. I'm just wondering/wanting to confirm as I'm very new to mediawiki, is this the right way to go about it?

Reply to "uploading doc files not "allowed" but doc is an allowed extension.. help?"