• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:File extension

  • Template
  • Talk
  • Language
  • Watch
  • View source
Template documentation[view] [edit] [history] [purge]
This template uses Lua:
  • Module:String (sandbox)


Outputs the file extension of the filename indicated by parameter {{{1}}}. In the File: namespace, this parameter defaults to {{PAGENAME}}. In all other namespaces, the default output is an empty string. Any uppercase letters in the file extension are changed to lowercase.

Usage

Input Output Notes
{{file extension}} (empty string output because current page is in the Template: namespace)
{{file extension|Makefile}} (empty string output because specified filename has no extension)
{{file extension|I-35.svg}} svg Input filename is acceptable with or without File: namespace prefix.
{{file extension|File:George H. Sharpe.jpg}} jpg
{{file extension|UNMSM logo1.PNG}} png Uppercase is changed to lowercase
{{file extension|Wikimedia Logo.jpeg}} jpeg jpeg is not changed to jpg
The above documentation is transcluded from Template:File extension/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:File_extension&oldid=1069318200"
Last edited on 1 February 2022, at 18:00

Languages

    • العربية
    • Slovenščina
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 1 February 2022, at 18:00 (UTC).
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Contact Wikipedia
    • Legal & safety contacts
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop