Last modified: 2014-02-12 23:32:47 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 29408 - Upload fails and unable to move existing .dem files without extension: "Key 'something.' is not in a proper format"
Upload fails and unable to move existing .dem files without extension: "Key '...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
1.20.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-15 05:06 UTC by msn
Modified: 2014-02-12 23:32 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Test case (708 bytes, application/x-httpd-php)
2011-06-18 11:34 UTC, Bryan Tong Minh
Details

Description msn 2011-06-15 05:06:56 UTC
Since updating to 1.17rc1 today, file uploads of types for which there is not a particular mime-type (in my case, ".dem" files, which are demo files from Valve's Source Engine games). Image uploads work fine.

Additionally, attempting to move already-uploaded .dem files, without changing the .dem extension, cause the error "The new file extension does not match its type" to appear (and the file doesn't move).

Output:

key 'fw9re1ay7wwdqf7p4c4eiyupmxwdezn.' is not in a proper format

Backtrace:
#0 /home/pwiki/www/w/includes/upload/UploadBase.php(634): UploadStash->stashFile('/tmp/phpNsK1a1', Array, NULL)
#1 /home/pwiki/www/w/includes/upload/UploadBase.php(646): UploadBase->stashSessionFile(NULL)
#2 /home/pwiki/www/w/includes/specials/SpecialUpload.php(367): UploadBase->stashSession()
#3 /home/pwiki/www/w/includes/specials/SpecialUpload.php(461): SpecialUpload->showUploadWarning(Array)
#4 /home/pwiki/www/w/includes/specials/SpecialUpload.php(192): SpecialUpload->processUpload()
#5 /home/pwiki/www/w/includes/SpecialPage.php(578): SpecialUpload->execute(NULL)
#6 /home/pwiki/www/w/includes/Wiki.php(251): SpecialPage::executePath(Object(Title))
#7 /home/pwiki/www/w/includes/Wiki.php(63): MediaWiki->handleSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))
#8 /home/pwiki/www/w/index.php(114): MediaWiki->performRequestForTitle(Object(Title), NULL, Object(OutputPage), Object(User), Object(WebRequest))
#9 {main}

Attached is the file that I am attempting to upload.
Comment 1 msn 2011-06-15 05:11:36 UTC
File is too large to attach, so I uploaded it there instead:
http://upload.gaiatools.com/files/p2escape_1_0.dem
Comment 2 Bryan Tong Minh 2011-06-15 07:25:40 UTC
Related to bug 26367, presumably happens when the file is not recognized by MimeMagic.

Assigning to Neil.
Comment 3 msn 2011-06-15 15:38:14 UTC
I tried adding the line:

application/octet-stream dem

to includes/MimeMagic.php, but it didn't change anything :(
Comment 4 Bryan Tong Minh 2011-06-18 11:34:03 UTC
Created attachment 8675 [details]
Test case

Test that should pass if this bug is fixed.
Comment 5 Bryan Tong Minh 2011-06-18 14:56:58 UTC
Fixed in r90340
Comment 6 msn 2011-06-18 16:32:53 UTC
Thanks! However, this does not fix the second half of the problem:
Attempting to move already-uploaded .dem files, without changing the .dem extension, causes the error "The new file extension does not match its type" to appear (and the file doesn't move).
Comment 7 Thehelpfulone 2012-06-22 19:41:11 UTC
Reassigning to wikibugs-l per bug 37789
Comment 8 Andre Klapper 2012-11-19 14:51:54 UTC
msn: Is moving already-uploaded .dem files still a problem in a recent MediaWiki version? If so, what are exact steps to reproduce?
Comment 9 Andre Klapper 2013-04-11 15:21:14 UTC
msn: Is moving already-uploaded .dem files still a problem in a recent
MediaWiki version? If so, what are exact steps to reproduce?
Comment 10 msn 2013-04-12 02:55:18 UTC
This is still present in MediaWiki 1.20.3.

Steps to reproduce:
- Upload the .dem file linked above
- Try to rename it to something else (keeping the .dem extension)

Error obtained:
"You do not have permission to move this page, for the following reason:

The new file extension does not match its type"

Perhaps interestingly, the file page - http://theportalwiki.com/wiki/File:Portal_2_-_Chapter_4_-_Chamber_21_%28Escape%29.dem - says "MIME type: application/vnd.ms-excel.sheet.binary.macroenabled.12" which is definitely inaccurate. I suspect that, when moving, it checks if the new filename's extension corresponds to the MIME type of the file, which MediaWiki incorrectly assigned to begin with.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links