InputfieldFile class

An Inputfield for handling file uploads

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the InputfieldFile class also inherits all the methods and properties of: Inputfield, WireData and Wire.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
InputfieldFile::get($key)
None 
InputfieldFile::getConfigInputfields()
InputfieldWrapper

Configuration settings for InputfieldFile

InputfieldFile::getDisplayBasename(Pagefile $pagefile)
string

Get a basename for the file, possibly shortened, suitable for display in InputfieldFileList

 
InputfieldFile::getItemInputfields()
bool InputfieldWrapper

Get custom Inputfields for editing given Pagefile

 
InputfieldFile::getWireUpload()
WireUpload

Return the current WireUpload instance or create a new one if not yet created

 
InputfieldFile::isEmpty()
None

Per Inputfield interface, returns true when this field is empty

 
InputfieldFile::processInput(WireInputData $input)
self

Process input

InputfieldFile::render()
string

Render Inputfield input

InputfieldFile::renderReady()
bool

Render ready

 
InputfieldFile::renderValue()
string

Render Inputfield value

InputfieldFile::set($key, $value)
None 
InputfieldFile::setAttribute($key, $value)
Inputfield InputfieldFile

Set an attribute

 
InputfieldFile::setMaxFilesize($filesize)
$this

Set the max file size in bytes or use string like "30m", "2g" "500k"

 
InputfieldFile::setParent(InputfieldWrapper $parent)
$this

Set the parent of this Inputfield

 

Properties

NameReturnSummary 
InputfieldFile::descriptionRows int Number of rows for description field or 0 to disable
DEFAULT: 1
 
InputfieldFile::destinationPath string Destination path for uploaded file or omit for auto. 
InputfieldFile::extensions string Allowed file extensions, space separated
DEFAULT: ''
 
InputfieldFile::itemClass string Class name(s) for each file item
DEFAULT: auto
 
InputfieldFile::maxFiles int Maximum number of files allowed or 0 for no max
DEFAULT: 0
 
InputfieldFile::maxFilesize int Maximum file size or 0 for auto detect
DEFAULT: 0
 
InputfieldFile::noAjax bool int Set to true or 1 to disable ajax uploading
DEFAULT: 0
 
InputfieldFile::noCollapseItem bool int Set to true to disable collapsed items (like for LanguageTranslator tool or other things that add tools to files)
DEFAULT: false
 
InputfieldFile::noCustomButton bool int Set to true to disable use of the styled <input type='file'>
DEFAULT: false
 
InputfieldFile::noLang bool int Set to true or 1 to disable multi-language descriptions
DEFAULT: 0
 
InputfieldFile::noShortName bool int Set to true to disable shortened filenames in output
DEFAULT: false
 
InputfieldFile::noUpload bool int Set to true or 1 to disable uploading to this field
DEFAULT: 0
 
InputfieldFile::okExtensions array File extensions that are whitelisted if any in $extensions are problematic. 3.0.167+
DEFAULT: []
 
InputfieldFile::overwrite bool int Whether or not overwrite mode is enabled
DEFAULT: false
 
InputfieldFile::tagsList string Predefined tags
DEFAULT: ''
 
InputfieldFile::unzip bool int Whether or not unzip is enabled
DEFAULT: false
 
InputfieldFile::uploadOnlyMode int Set to true or 1 to disable existing file list display, or 2 to also prevent file from having 'temp' status.
DEFAULT: 0
 
InputfieldFile::useTags bool Whether or not tags are enabled
DEFAULT: false
 
InputfieldFile::value Pagefiles Pagefile null Value attribute  

Additional methods and properties

In addition to the methods and properties above, InputfieldFile also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.252