Page MenuHomePhabricator

Tweak MediaWiki API siteinfo siprop fileextensions description text
Closed, ResolvedPublic

Description

The MediaWiki Web API (e.g., https://www.mediawiki.org/w/api.php) should support outputting a wiki's list of permitted file types when uploading. This information is exposed at [[Special:Upload]], but it'd be useful to have programmatic access to it, I think. Maybe.


Version: 1.23.0
Severity: enhancement
Whiteboard: permitted file type file types

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:58 AM
bzimport set Reference to bz60121.
bzimport added a subscriber: Unknown Object (MLST).

What list is this, specifically? The only list I see at [[Special:Upload]] is already available via https://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=fileextensions

(In reply to comment #1)

What list is this, specifically? The only list I see at [[Special:Upload]] is
already available via
https://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=fileextensions

Oh, there it is. Thanks.

The user interface uses the term "file types" ([[mw:Special:Upload]]), as does Commons ([[commons:Commons:File types]]). Consequently I overlooked this part of the API as I didn't think to look for "file extension". I checked the action=upload module, but to no avail. There's probably not a valid bug here, though I do wonder if the discoverability of this siprop is sufficient.

The difference is probably because "file extension" is more technically correct while "file types" is more likely to be understood by general users.

As a programmer, I wasn't sure whether "file types" was meaning extensions, MIME types, or what else.

I just went looking for this list again and it took me too long. I tried "file type" and "upload" again before eventually re-remembering that it's "extensions" that I need to search for at https://commons.wikimedia.org/w/api.php. Hrmph. I finally got back to https://commons.wikimedia.org/w/api.php?action=query&meta=siteinfo&siprop=fileextensions.

Let's please change the siteinfo siprop description text for fileextensions to include a parenthetical:

fileextensions - Returns list of file extensions allowed to be uploaded

becomes...

fileextensions - Returns list of file extensions (file types) allowed to be uploaded

(In reply to MZMcBride from comment #4)

I just went looking for this list again and it took me too long. I tried
"file type" and "upload" again

"upload" should have worked. As you yourself quoted:

fileextensions - Returns list of file extensions allowed to be uploaded

^^^^^^
Sumit set Security to None.

Change 181364 had a related patch set uploaded (by Anomie):
Added a parenthetical to fileextensions description in api help at meta=siteinfo&siprop=fileextensions

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

Patch-For-Review

Change 181364 merged by jenkins-bot:
Added a parenthetical to fileextensions description

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