Topic on Project:Support desk

Error: File extension does not match MIME type

12
Arg0n4th (talkcontribs)

Hi,

i downloaded last week Mediawiki, all seems to work perfectly except the Upload. I got the error:

"File extension does not match MIME type"

I already tried to google it, and also I try to change differeten parameter on php.ini and LocalSettings.php.

The symptoms are:

1) The error: "File extension does not match MIME type" 2) the file is not created in tmp directory (neither windows/temp neither other tmp dir) 3) none extension work 4) changing:

$wgVerifyMimeType = false;
$wgStrictFileExtensions = false;
$wgCheckFileExtensions = false;

I got "The file has no extension (es. jpg)"

Help

I don't have an online version Federico


mediawiki: 1.16.1 PHP: 5.2.14 Mysql: 5.0.51a Apache: 2.2.8 on Windows 7 64bit

Unifiedrepublic (talkcontribs)

Make sure that when you upload a file, the file name in MediaWiki has an extension also. There are two file names. The name of the file being uploaded and the one MW will reference it by. It's this second one, the one that can be defined in the text box, that must have an extension.

Arg0n4th (talkcontribs)

Wow, you solved my problem..

Ty

Federico

71.237.71.114 (talkcontribs)

Hi folks, I'm running into the same issue trying to upload a .doc file. Same error even though the destination filename has a .doc extension and doc is one of the allowed upload types. Ideas?

Unifiedrepublic (talkcontribs)

I don't think .doc is an inherently supported type. Wish I had more information for you.

175.137.86.207 (talkcontribs)

I have the same problem trying to upload some .png files. Please help!

John Bentley~mediawikiwiki (talkcontribs)
163.231.6.65 (talkcontribs)

John - that work-around worked for us... thank you!!!

David - Seattle, WA, U.S.A.

87.214.82.181 (talkcontribs)

I had a jpg and then i wanted to replace it with a png What do i do???

Reach Out to the Truth (talkcontribs)

Upload the PNG separately, update links to point to the new new image, then delete or otherwise deprecate the JPEG version.

Jpond (talkcontribs)

You may also want to look at the include/mime.types file if the above fixes haven't worked.

My issue was the delta between the default apache mime.types and this file, specifically:

# From Apache
text/plain					txt text conf def list log in

# From include/mime.types
text/plain txt
Simon Stier (talkcontribs)
Reply to "Error: File extension does not match MIME type"