Extension:Filepath

Filepath is a special page extension by Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt; that allows user agents to get the full path of a file from its name.

The extensions can be downloaded from the Filepath directory in the extensions module in MediaWiki CVS HEAD.

Description
The page allows the user agent to submit a GET or POST form where the file field is the name of the file (without its associated namespace) to get the full path of, it also support the syntax Special:Filepath/File.ogg. If the file exists the user agent will be redirected via a   header to its full path, and if it doesn't exist the form will be presented again.

Status codes
The page will return different HTTP status codes depending on whether or not the image requested exists:


 * File exists:  and a   header that contains the full url of the image
 * File does not exist:
 * No file requested:

Example

 * commons:Special:Filepath/AS8-13-2329.jpg will redirect to http://upload.wikimedia.org/wikipedia/wikipedia/commons/d/dc/AS8-13-2329.jpg. A link from meta to that Commons file - [[media:AS8-13-2329.jpg]], does the same.

However, for an image on a project other than the project itself or commons, "media:" gives the description page, while filepath gives the image itself, e.g.:


 * nl:media:Wijken denhaag.gif
 * nl:Special:Filepath/Wijken denhaag.gif

Download

 * SpecialFilepath.php on SVN
 * SpecialFilepath.i18n.php on SVN
 * SpecialFilepath_body.php on SVN

Installation

 * 1) Download all Files, put in a new directory /extensions/FilePath
 * 2) create a file /extensions/ExtensionFunctions.php, put in the source code from here.
 * 3) Add to LocalSettings.php "require_once( "$IP/extensions/FilePath/SpecialFilepath.php");"