Page MenuHomePhabricator

"The filename is not allowed." when attempting to upload MP4 file on en.wiki
Open, Needs TriagePublic

Description

Steps to reproduce:
Upload video via "Insert" button in Visual Editor

Observed Result:
About a second after encountering the "Details" dialogue, the error pops up and blocks engagement.

Expected Result:
Video uploads and the page allows for interaction with the dialogue.

Screenshot/Screen capture:


Device:
MacBook Air 13-inch Early 2015

Browser:
Chrome Version 87.0.4280.88 (Official Build) (x86_64)

Wiki:
https://en.wikipedia.org/

Editor:
VE

Page:
https://en.wikipedia.org/wiki/Spotted_sandpiper

Environment:
Production

Event Timeline

After getting this message on Commons

I assume the en.wiki error is because VE does not support .mp4 files. However, the error seems to suggest that the name of the file is the issue (which is sort of true, though editing out ".mp4" from the filename does not change the issue). So, this might not be a bug, but rather a feature request for a clearer error message. :)

Jdforrester-WMF added a subscriber: Jdforrester-WMF.

The cross-wiki upload tool is not VE-specific, it's also in the 2010 and 2017 wikitext editors. Unfortunately there's no Multimedia team any more…

Re-wording the error message from "extension" to "file type" is easy, but not necessarily much more helpful…

The API error is illegal-filename so the editor is behaving correctly. This is a bug in ApiUpload::verifyUpload() - in the chunked upload code path, it is checking UploadBase::getTitle() and then returning a useless error message, instead of checking UploadBase::validateName() which would provide a useful error.

Ha. I guess it should call them the other way around?

… or given that checkVerification handles case UploadBase::ILLEGAL_FILENAME and case UploadBase::FILETYPE_MISSING, just scrap it? But then, there's also case UploadBase::FILE_TOO_LARGE

Yeah, just scrap, I think. FILE_TOO_LARGE and the other UploadBase::verifyUpload() stuff will be checked later - AIUI the first two branches in ApiUpload::verifyUpload() are called for individual chunks so most checks wouldn't make sense there. After the file is assembled, it will be called again and will use the last branch.

Change 654479 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] ApiUpload: Don't error about filenames on partially-uploaded files

https://gerrit.wikimedia.org/r/654479