Page MenuHomePhabricator

JPEG Image Upload = 'File extension does not match MIME type'
Closed, InvalidPublic

Description

Author: zrhwiki

Description:
Uploading a JPEG image results always in the following error message:

'File extension does not match MIME type.'

I am able to reproduce the issue with all kind of JPEG pictures (i.e. my own, from Google Images, from Wikipedia, etc.)

Please let me know if you need further information, thank you.


Version: 1.17.x
Severity: major

Details

Reference
bz22819

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:05 PM
bzimport set Reference to bz22819.
bzimport added a subscriber: Unknown Object (MLST).

zrhwiki wrote:

In German, the error message is the following:

'Dateierweiterung stimmt nicht mit dem MIME-Typ überein.'

The issue is reproducible with the latest SVN version of MediaWiki.

nat wrote:

Same here (MW 1.17alpha (r63735)) with a PNG file.

In upload/UploadBase.php the 'verifyFile' function debug shows:
"mime: <image/png> extension: <>"

Thank you

Bryan.TongMinh wrote:

Can you give a link to a specific image that causes this error?

zrhwiki wrote:

(In reply to comment #3)

Can you give a link to a specific image that causes this error?

http://zrhwiki.ch/tmp/test.jpg

zrhwiki wrote:

(In reply to comment #0)

Uploading a JPEG image results always in the following error message:

'File extension does not match MIME type.'

I am able to reproduce the issue with all kind of JPEG pictures (i.e. my own,
from Google Images, from Wikipedia, etc.)

Please let me know if you need further information, thank you.

The issue is not limited to JPEG pictures, all uploads are affected.

Bryan.TongMinh wrote:

Does your debug log tell you more about the mime type? The file you linked was correctly identified as image/jpeg on my test wiki.

zrhwiki wrote:

I am no longer able to reproduce the problem. The reason might be a recent web server update, i.e. the old configuration might have caused the problem.

Thank you for your help!