Extension:Filepath
|
|
This extension is obsolete! It has been replaced by core functionality in the MediaWiki software (which was added in version 1.12.0). |
|
Filepath Release status: stable |
|
|---|---|
| Implementation | Special page |
| Description | Allows user agents to get the full path of a file from its name. |
| Author(s) | Ævar Arnfjörð Bjarmason |
| MediaWiki | 1.7.0 or later |
| License | No license specified |
| Download | Download snapshot Subversion [Help] |
|
Check usage (experimental) |
|
Filepath is a special page extension by Ævar Arnfjörð Bjarmason <avarab@gmail.com> that allows user agents to get the full path of a file from its name. This functionality was added to core MediaWiki 1.12a in r30404.
Contents |
[edit] Synopsis
Special:Filepath/File.oggSpecial:Filepath?file=File.ogg
[edit] 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 Location: header to its full path, and if it doesn't exist the form will be presented again.
[edit] Status codes
The page will return different HTTP status codes depending on whether or not the image requested exists:
- File exists
302 Foundand aLocationheader that contains the full url of the image- File does not exist
404 Not Found- No file requested
200 OK
[edit] Example
- commons:Special:Filepath/AS8-13-2329.jpg will redirect to http://upload.wikimedia.org/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" doesn't go to the internal but external "Media:" namespace, because it resolves the "nl" interwiki first, leaving "http://nl.wikipedia.org/wiki/Media:Wijken_denhaag.gif". When linked directly and internally from within a wiki, "Media:" goes to the filepath.
[edit] Installation
- Download the latest snapshot and extract it to your extensions directory.
- Add the following to LocalSettings.php:
require_once( 'extensions/Filepath/SpecialFilepath.php' );
| Language: | English • Français |
|---|
