ListFiles

ListFiles is a site-wide and user script for file management. It provides a form for building URL's to query the MediaWiki API, as well as an extensive list of options for formatting the data after retrieval. Some things you can do with this script are:
* alphabetically enumerate all files on a wiki
* search for all files that have a certain prefix
* get a list of files larger than 1 MB
* generate new lists without reloading the page
* save and reset your settings
* sort files by name, uploader, timestamp, width, etc.
* lists generated in raw text can be parsed and used with other applications such as bots
Some things you cannot do with this script are:
* easily find all files uploaded recently (use the Special:NewFiles special page instead)
* find all .png images on a wiki. The aimime parameter could be used to search for files by mime type... but unfortunately it's server-intensive and is disabled across Fandom.
== ==
== ==
Once the ListFiles script is installed, you can visit Project:ListFiles on your wiki to see the script in action. It will also load on subpages in the User: namespace that have 'ListFiles' in the title, e.g. User:Username/ListFiles – this is designed to be useful for people who have the script in their global.js.
If you'd like to force this script to load on different page, simply edit whichever page you want and place the following wikitext there:
The id="ListFiles-container" is the important part. The ListFiles script will look for a container that has that id, so if you put such a container on any page, the script will run on that page.
== Raw text list of filenames ==
A side feature of this script is that it provides a raw text list of filenames on the following special pages:
* Special:ListFiles
* Special:UnusedFiles
* Special:UncategorizedFiles
These raw text lists can be useful for someone with a bot or automation script. For example, if you wanted to delete unused images on your wiki, you could visit Special:UnusedFiles and copy the raw text list of files provided by this script, and then feed that input through the AjaxBatchDelete script to easily mass delete them.
== Changelog ==