Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 15:31, 10 February 2015 by commons>Rillke (umm)

This is the documentation page for Module:File

Scope

File title and file information. If the code here grows beyond a border line, this should be converted to an interface and the processing code should be outsourced.

Usage

From Wikitext

Search (Template:Key press) for @exports.

Examples:
{{#invoke:File|extension|file=File:Test.jpg}}jpg
{{#invoke:File|width|file=File:Test.jpg}}3120
{{#invoke:File|dateWorkCreated|file=File:Ballot-sprite.png}}
{{#invoke:File|fileExists|file=File:Ballot-sprite.png}}true

From Lua

local file = require( 'Module:File' )
local fileObj = file.File( 'Foo.bar.svg' )
local withoutExtension = fileObj.woExtension()
-- withoutExtension is now 'Foo.bar'

local exists = file.metadata().exists
if exists then
   mw.log( file.metadata().width )
end
Cookies help us deliver our services. By using our services, you agree to our use of cookies.