Last modified: 2014-07-18 12:41:31 UTC
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.
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 ^^^^^^