Help:Files

A file is a type of media content that can be displayed on a page. Types of files include images, video, audio clips, and more. Files can be uploaded using the upload page, and will be stored in the File namespace (where page titles begin with the prefix File:, note the colon). Files can be embedded and displayed on a page using the syntax, much like a regular wikilink.

Permitted file types
The following file types can be uploaded to :

Images:
 * GIF, JPEG, PNG, ICO, SVG

Audio:
 * OGG / OGA, FLAC, OPUS, WAV, MP3

Video:
 * OGG / OGV, WebM

Documents:
 * DjVu, PDF

Uploading files
Before a file can be used on, it must be uploaded to the wiki first. When uploading, please keep the following in mind:


 * Files on must have a unique name. For example, if there is already a file named "Flower.jpg" on, you cannot upload another file of the exact same name without overriding it.
 * Please give your files a specific name. This will help reduce conflicts and make it easier for others to know what your file is about. For example, "Sunflowers growing off Highway 50 in Leslieville.jpg" is a much better name than "Sunflowers.jpg" or "Highway 50.jpg". You will have the option to rename your file when it is being uploaded.
 * You can use the same file on multiple pages on the wiki, or even multiple times on the same page. As such, please try to avoid uploading duplicates.

Once you have uploaded a file, it will not appear on any pages at first, although it will exist on the servers and can be used at any time. You can use files on a page by typing, replacing filename.extension with the name of the file as you uploaded it as. For example, if you uploaded a file called Portrait of John Doe.jpg, you would use it in an article by editing the article you want to add the file to and typing  onto the page.

Like regular wiki pages, files have revision histories too. When a file with the same name as an existing file gets uploaded, it will override the existing file. All previous versions of a file are kept in the file's file history, and can be viewed by anyone. Anyone who can upload files can also revert a file to an older version.

File description page
When you upload a file to, a file description page is automatically created for it. These pages are used to contain important information relating to the file, such as its licensing and copyright status, the author who created it, where it was produced, and any modifications made to it. File description pages are located in the "File" namespace, and as such, their page names will begin with File: (note the colon). Their names will correspond to the name of the file on the wiki. For example, if you upload a file titled "John Doe.jpg", the file description page for that file will be "File:John Doe.jpg".

When you view a file description page, the most current version of the uploaded file will be displayed at the top, and the contents of the file description page will appear below it. When you click the "Edit" button on a file description page, you will be able to edit the file description page, but not the uploaded file itself.

Files from Commons
Files from the Wikimedia Commons can also be used on. The Wikimedia Commons is a free-to-use media repository that contains over 50 million images, audio clips, and video files that can be used on without having to be uploaded again. Files from the Wikimedia Commons can also be used on Wikipedia, Wiktionary, and other Wikimedia-related sites.

When you view the file description page for a file that is being hosted on the Wikimedia Commons, the following message will appear:

The Wikimedia Commons only accepts freely usable files; this means that most copyrighted images on the Internet cannot be uploaded to Commons. You will need a separate Wikimedia account in order to upload to Commons as well. You can upload files to the Wikimedia Commons using their Upload Wizard.

Embedding images
The syntax to embed a single image is:

options can either be excluded (which will show the image in its full size), or contain one or more of the following parameters, each separated by pipes (|), that can be used to resize and format the image for better display.

Format
Formatting options control how the rendered image is formatted and embedded in the rest of the page.

If the height of an image in thumbnail is bigger than its width (i.e. in portrait orientation rather than landscape) and you find it too large, you may try the option, where N is the image's aspect ratio (its width divided by its height, defaulting to 0.75). The alternative is to specify the desired maximum height (in pixels) explicitly.

You can also use  to specify a different image for the thumbnail.

Size and frame
The size parameter can be used to resize the image, either to fit within a given resolution in pixels, or to resize them according to the user's preferences. The image will always retain its aspect ratio.

Horizontal alignment
When using the  or   formats, the default alignment will always be right.

Vertical alignment
The vertical alignment options take effect only if the image is rendered as an inline element and is not floating. They alter the way the inlined image will be vertically aligned with the text present in the same block before and/or after this image on the same rendered row.

Note that the rendered line of text where inline images are inserted (and the lines of text rendered after the current one) may be moved down (this will increase the line-height conditionally by additional line spacing, just as it may occur with spans of text with variable font sizes, or with superscripts and subscripts) to allow the image height to be fully displayed with this alignment constraint.

View source code

To show the alignment result more clearly, the text spans are overlined and underlined, the font-size is increased to 200%, and the paragraph block is outlined with a thin border; additionally images of different sizes are aligned:

 text top: text

 text text-top: text

 text super: text

 text baseline: text

 text sub: text

 text default: text

 text middle: text

 text text-bottom: text

 text bottom: text

Notes:


 * 1) The "middle" vertical alignment position of the image (which is also the default) usually refers to the middle between the x-height and the baseline of the text (on which the vertical middle of the image will be aligned, and on which usually the text may be overstroke), but not to the middle of the line-height of the font-height that refers to the space between the "text-top" and "text-bottom" positions ; the font-height excludes:
 * 2) * the additional line separation spacing normally divided equally into two line-margins (here 0.5em, according to line-height set to 200%) above and below the font-height).
 * 3) * the additional line spacing which may be added by superscripts and subscripts.
 * 4) However, if the image height causes its top or bottom position to go above or below the normal full line-height of text, the middle position will be adjusted after the increasing the top and/or bottom line-margins so that the image can fit and align properly, and all images (including those with smaller heights) will be vertically centered on the adjusted middle position (for computing the effective line-height, the text of each rendered row with the larger font-height will be considered).
 * 5) The "text-top" and "text-bottom" alignment positions also excludes the extra line spacing added by superscripts and subscripts, but not the additional line-spacing defined by the line-height.
 * 6) The "top" and "bottom" alignment positions take into account all these extra line spacings (including superscripts and subscripts, if they are present in a rendered line span). When the image alignment constrains the image to grow above or below the normal line-spacing, and the image is not absolutely positioned, the image will cause the "top" and "bottom" positions to be adjusted (just like superscripts and subscripts), so the effective line-height between rendered lines of text will be higher.
 * 7) The "underline", "overline" and "overstrike" text-decoration positions should be somewhere within these two limits and may depend on the type and height of fonts used (the superscript and subscript styles may be taken into account in some browsers, but usually these styles are ignored and the position of these decorations may not be adjusted); so these decorations normally don't affect the vertical position of images, relatively to the text.

Link target
By default, clicking on an image will take you to the file description page for that image. You can change the link to point to a different page on-wiki, to an external link, or remove the link entirely.

Alt text
The  parameter can be used to specify alt text that will be used by screen readers, or when the image cannot be loaded. You can provide a short description of the image here that someone who cannot see the image can read instead. Alt text does not affect the display of the image to other people.

Galleries
Images can be easily grouped together into galleries using the  tag. The syntax is:

Gallery parameters
The gallery tag itself can take a number of parameters:


 * : Sets a caption centered atop the gallery. Only plain text may be used in the caption; formatting, templates and the like will not work. If the caption is more than one word, double quotes must be used (e.g. ).
 * : Sets the (max) widths of the images; the default value is 120px. Note the plural: widths.
 * : Sets the (max) heights of the images; the default value is 120px. Note the plural: heights.
 * : Sets the number of images per row. If set to 0, the gallery will automatically adjust based on the width of the screen.
 * : Shows the filenames of the images in the individual captions for each image.
 * : See section below.
 * : For "slideshow" mode only, display the strip with image thumbnails below the slideshow by default.

Mode parameter
The mode parameter accepts the following inputs:


 * : The default gallery styling, with border lines and a white box between the images.
 * : Similar to, but with no border lines.
 * : Images will have the same height but different widths, with little space between the images. The gallery is responsive and will organize the images according to the width of the screen.
 * : Shows the caption overlaid on the image, in a semi-transparent white box.
 * : Similar to, but with the caption and box only showing up on hover.
 * : Creates a slideshow of the images.

Embedding audio
Similar syntax is employed when using audio files.

There is also an option to preset the player to start at a specified time in the track, rather than at the start.

Audio files can be used in galleries, like images.

Embedding video
Embedding video follows a similar syntax to embedding audio files.

The  and   parameters can be used to have a video start and end at a specified point, in seconds.

The  parameter can be used to specify the thumbnail shown for the video before it has been played. Give the time as either the number of seconds into the video, or in a  format. By default, a frame from the midpoint of the video is used as the thumbnail.

Videos can also be embedded inside a gallery.

Linking to a file
When you type  onto a page, the file will be embedded into the page and be shown to readers. If you want to simply link to the file description page, you will need to prefix the link with a colon. For example,  will produce a regular wikilink to the file description page for Portrait of John Doe.jpg, rather than embedding the image.