WireUpload class

Located in file /wire/core/WireUpload.php

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

Show class?             Show args?        

Common

NameReturnSummary 
WireUpload::error($text)
Wire WireUploadRecord an error message 
WireUpload::execute()
arrayExecute/process the upload 
WireUpload::getCompletedFilenames()
arrayGet array of uploaded filenames 
WireUpload::getErrors()
arrayGet error messages 
WireUpload::getOriginalFilenames()
arrayGet unsanitized array of original filenames (basenames) indexed by completed basename 
WireUpload::getOverwrittenFiles()
arrayGet files that were overwritten (for overwrite mode only) 
WireUpload::isAjaxUploading()
boolIs an ajax upload request currently in progress? 
WireUpload::setAllowAjax()
$thisSet whether or not AJAX uploads are allowed 
WireUpload::setDestinationPath(string $destinationPath)
$thisSet the destination path for uploaded files 
WireUpload::setExtractArchives()
$thisSet whether or not ZIP files may be extracted 
WireUpload::setLowercase()
$thisSet whether or not lowercase is enforced 
WireUpload::setMaxFileSize(int $bytes)
$thisSet the max allowed uploaded file size 
WireUpload::setMaxFiles(int $maxFiles)
$thisSet the max allowed number of uploaded files 
WireUpload::setName(string $name)
$thisSet the upload field name (same as that provided to the constructor) 
WireUpload::setOverwrite(bool $overwrite)
$thisSet whether or not overwrite is allowed 
WireUpload::setOverwriteFilename(string $filename)
$thisSet the filename that may be overwritten (i.e. myphoto.jpg) for single uploads only 
WireUpload::setTargetFilename($filename)
(nothing)Set the target filename, only useful for single uploads 
WireUpload::setValidExtensions(array $extensions)
$thisSet allowed file extensions 
WireUpload::validateFilename(string $value)
bool stringSanitize/validate a given filename 
WireUpload::wired()
(nothing)Wired to API 

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #551
    In the 551st issue of ProcessWire Weekly we'll check out what's new in the core this week, share a new weekly poll, and more. Read on!
    Weekly.pw / 1 December 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“Yesterday I sent the client a short documentation for their ProcessWire-powered website. Today all features already used with no questions. #cmsdoneright—Marc Hinse, Web designer/developer