FieldtypeFile class

Field that stores one or more files

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

Show class?             Show args?        

Common

NameReturnSummary 
FieldtypeFile::allowFieldtypes array Allowed Fieldtype types for custom fields 
FieldtypeFile::cloneField(Field $field)
FieldReturn a cloned copy of $field
FieldtypeFile::defaultFileExtensions string 
FieldtypeFile::deleteField(Field $field)
boolDelete field
FieldtypeFile::deletePageField(Page $page, Field $field)
boolDelete field from page
FieldtypeFile::emptyPageField(Page $page, Field $field)
boolEmpty field from page
FieldtypeFile::exportValue(Page $page, Field $field, $value)
array float int stringExport value
FieldtypeFile::formatValue(Page $page, Field $field, Pagefiles $value)
Pagefiles PagefilePerform output formatting on the value delivered to the API
FieldtypeFile::formatValueString(Page $page, Field $field, $value)
string
FieldtypeFile::get($key)
mixedGet a property from this Fieldtype’s data 
FieldtypeFile::getBlankValue(Page $page, Field $field)
PagefilesGet blank value 
FieldtypeFile::getCompatibleFieldtypes(Field $field)
FieldtypesGet compatible Fieldtypes
FieldtypeFile::getConfigAdvancedInputfields(Field $field)
InputfieldWrapperField advanced config
FieldtypeFile::getConfigInputfields(Field $field)
InputfieldWrapperField config
FieldtypeFile::getDatabaseSchema(Field $field)
arrayGet database schema 
FieldtypeFile::getFieldSetups()
arrayGet setup options and setup functions for new fields
FieldtypeFile::getFilesPath(Page $page, Field $field)
stringGet path where files are (or would be) stored 
FieldtypeFile::getInputfield(Page $page, Field $field)
InputfieldGet the Inputfield module to handle input for this Fieldtype 
FieldtypeFile::getLoadQueryAutojoin(Field $field, DatabaseQuerySelect $query)
DatabaseQuerySelect nullDisable autojoin for files 
FieldtypeFile::getMatchQuery($query, string $table, string $subfield, string $operator, mixed $value)
DatabaseQuery DatabaseQuerySelectGet match query 
FieldtypeFile::getPagefile(Page $page, string $basename)
Pagefile nullGiven a Page and file basename, return the Pagefile object if file is found for Page 
FieldtypeFile::getPagefiles(Page $page, Field $field)
PagefilesGet Pagefiles 
FieldtypeFile::getSelectorInfo(Field $field)
arrayGet selector info
FieldtypeFile::getValidFileExtensions($field)
arrayCheck file extensions for given field and return array of validity information 
FieldtypeFile::loadPageField(Page $page, Field $field)
array null@param Page $page
FieldtypeFile::markupValue(Page $page, Field $field)
string MarkupFieldtypeRender a markup string of the value.
FieldtypeFile::renamedField(Field $field, string $prevName)
(nothing)Called after field renamed
FieldtypeFile::sanitizeValue(Page $page, Field $field, mixed $value)
PagefilesSanitize value 
FieldtypeFile::sleepValue(Page $page, Field $field, $value)
arrayGiven an 'awake' value, as set by wakeupValue, convert the value back to a basic type for storage in DB.
FieldtypeFile::wakeupValue(Page $page, Field $field, $value)
Pagefiles nullGiven a raw value (value as stored in DB), return the value as it would appear in a Page object

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.244

Latest news

  • ProcessWire Weekly #558
    In the 558th issue of ProcessWire Weekly we'll check out the blog post that introduces ProcessWire 3.0.244, share some recent ProcessWire highlights, and more. Read on!
    Weekly.pw / 18 January 2025
  • ProcessWire 3.0.244 new main/master version
    ProcessWire 3.0.244 is our newest main/master/stable version. It's been more than a year in the making and is packed with tons of new features, issue fixes, optimizations and more. This post covers all the details.
    Blog / 18 January 2025
  • Subscribe to weekly ProcessWire news

“…building with ProcessWire was a breeze, I really love all the flexibility the system provides. I can’t imagine using any other CMS in the future.” —Thomas Aull