Page MenuHomePhabricator

uploadcorrupt error message is vague and confusing
Closed, DeclinedPublic

Description

The uploadcorrupt message, "The file is corrupt or has an incorrect extension. Please check the file and upload again." is vague and confusing and commonly leads to support requests:

http://toolserver.org/~mzmcbride/cgi-bin/mw-logs.py?search=The%20file%20is%20corrupt%20or%20has%20an%20incorrect%20extension

It can be generated when either:

  • MimeMagic detected unknown/unknown but extension is listed as "recognizable", or
  • MimeMagic detected a type which was different to the type suggested by the extension.

The details of why the upload was rejected are logged in exquisite detail to the debug log, but the user doesn't get to see any of that. Some users (presumably Windows users from the post Win 95 era) don't really understand file extensions and are easily confused by talk about them. Sometimes the error is the fault of the external detection utility and extra details need to be provided for debugging.

I suggest:

  • Splitting messages for the unknown/unknown case from the "different MIME type" case
  • Mapping the most common file extensions and the most common MIME types to a set of localised messages, so that we can talk about e.g. "JPEG" instead of "image/jpeg" and ".jpg".
  • Providing the detected type, the file extension, and the type that the file extension implies, as message parameters.

Version: 1.16.x
Severity: normal

Details

Reference
bz18923

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:38 PM
bzimport set Reference to bz18923.
bzimport added a subscriber: Unknown Object (MLST).

karun.84 wrote:

Patch for Splitting Messages

I have begun working on this bug. I attach a simple patch that splits the messages. I am not yet so sure about localised messages or what to do to add the message to multiple languages, as I have not used them previously.

attachment 18923.patch ignored as obsolete

karun.84 wrote:

Patch that splits messages

I have removed LocalSettings.php from the initial diff.

attachment 18923.patch ignored as obsolete

This patch seems to reject all files whose type is not detected, which is a change in behavior from the current code; if we're configured to allow non-blacklisted file extensions to be uploaded, and we can't detect a mime type out of it successfully, and it's not an extension that we know we can recognize for sure, then previously we'd let it through.

karun.84 wrote:

The uploadcorrupt message is no longer used in the current release of MediaWiki so does not require fixing.

karun.84 wrote:

Comment on attachment 6557
Patch that splits messages

No longer required as uploadcorrupt is no longer used.