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

“The end client and designer love the ease at which they can update the website. Training beyond how to log in wasn’t even necessary since ProcessWire’s default interface is straightforward.” —Jonathan Lahijani