InputfieldFile class

One or more file uploads (sortable)

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?        

Common

NameReturnSummary 
descriptionRows int Number of rows for description field (default=1, 0=disable) 
destinationPath string Destination path for uploaded file 
extensions string Allowed file extensions, space separated 
extractMetadata(Pagefile $pagefile)
array)
fileAdded(Pagefile $pagefile)
(nothing)
get($key)
mixed nullGet a property or attribute from the Inputfield 
getConfigInputfields()
InputfieldWrapperConfiguration settings for InputfieldFile
getDisplayBasename(Pagefile $pagefile)
stringGet a basename for the file, possibly shortened, suitable for display in InputfieldFileList 
getItemInputfields()
bool InputfieldWrapperGet custom Inputfields for editing given Pagefile 
getWireUpload()
WireUploadReturn the current WireUpload instance or create a new one if not yet created 
isEmpty()
boolPer Inputfield interface, returns true when this field is empty 
itemClass string Class name(s) for each file item (default=InputfieldFileItem ui-widget ui-widget-content) 
maxFiles int Maximum number of files allowed 
maxFilesize int Maximum file size 
noAjax bool int Set to true or 1 to disable ajax uploading 
noCollapseItem bool int Set to true to disable collapsed items (like for LanguageTranslator tool or other things that add tools to files) 
noCustomButton bool int Set to true to disable use of the styled <input type='file'> 
noLang bool int Set to true or 1 to disable multi-language descriptions 
noShortName bool int Set to true to disable shortened filenames in output 
noUpload bool int Set to true or 1 to disable uploading to this field 
okExtensions array File extensions that are whitelisted if any in $extensions are problematic. (3.0.167+) 
overwrite bool int Whether or not overwrite mode is enabled 
processInput(WireInputData $input)
selfProcess input
processInputAddFile($filename)
Pagefile null
processInputDeleteFile(Pagefile $pagefile)
(nothing)
processInputFile(WireInputData $input, Pagefile $pagefile, $n)
bool
processItemInputfields(Pagefile $pagefile, InputfieldWrapper $inputfields, $id, WireInputData $input)
bool
render()
stringRender Inputfield input
renderItem($pagefile, $id, $n)
string
renderList($value)
string
renderReady()
boolRender ready 
renderUpload($value)
string
renderValue()
stringRender Inputfield value
set($key, $value)
Inputfield WireDataSet a property or attribute to the Inputfield 
setAttribute($key, $value)
Inputfield InputfieldFileSet an attribute 
setMaxFilesize($filesize)
$thisSet the max file size in bytes or use string like "30m", "2g" "500k" 
setParent(InputfieldWrapper $parent)
$thisSet the parent of this Inputfield 
tagsList string Predefined tags 
unzip bool int Whether or not unzip is enabled 
uploadOnlyMode int Set to true or 1 to disable existing file list display, or 2 to also prevent file from having 'temp' status. 
useTags bool Whether or not tags are enabled 
value Pagefiles Pagefile null 

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

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits