Extension:Filepath

From MediaWiki.org

Jump to: navigation, search
This feature has been deprecated and should not be used with current versions of MediaWiki.

This feature was deprecated (or possibly removed completely) in version 30404.

Manual on MediaWiki Extensions
List of MediaWiki Extensions
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
Download SVN (browse)
log

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.ogg
  • Special: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 Found and a Location header that contains the full url of the image
File does not exist
404 Not Found
No file requested
200 OK

[edit] Example

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.:

[edit] Installation

  1. Download all files from SVN and put in a new directory /extensions/Filepath
svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Filepath
  1. Download ExtensionFunctions.php if you don't already have it.
  2. Add the following to LocalSettings.php:
require_once( 'extensions/Filepath/SpecialFilepath.php' );
Personal tools