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::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 

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

Twitter updates

  • Quick weekly update covering this week's commits for the upcoming 3.0.167 ProcessWire core version— More
    18 September 2020
  • This week ProcessWire version 3.0.166 is released on the dev branch. In this post we’ll cover all that’s new relative to the previous version, 3.0.165. Plus we’ll check out the latest new versions of ProCache and FormBuilder— More
    11 September 2020
  • Weekly update – 28 August 2020 – New secure files option defined per-template: More
    28 August 2020

Latest news

  • ProcessWire Weekly #332
    In the 332nd issue of ProcessWire Weekly we'll cover the latest core updates, introduce some new and updated ProcessWire resources, and more. Read on!
    Weekly.pw / 19 September 2020
  • ProcessWire 3.0.166 core updates and more
    This week ProcessWire version 3.0.166 is released on the dev branch. In this post we’ll cover all that’s new relative to the previous version, 3.0.165. Plus we’ll check out the latest new versions of ProCache and FormBuilder.
    Blog / 11 September 2020
  • Subscribe to weekly ProcessWire news

“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