Overview

Namespaces

  • None
  • PHP

Classes

  • Breadcrumb
  • Breadcrumbs
  • CacheFile
  • Comment
  • CommentArray
  • CommentFilter
  • CommentForm
  • CommentList
  • Config
  • Database
  • DatabaseQuery
  • DatabaseQuerySelect
  • DatabaseQuerySelectFulltext
  • DatabaseStopwords
  • Debug
  • Field
  • Fieldgroup
  • Fieldgroups
  • FieldgroupsArray
  • Fields
  • FieldsArray
  • Fieldtype
  • FieldtypeMulti
  • Fieldtypes
  • FileLog
  • FilenameArray
  • Fuel
  • HookEvent
  • ImageSizer
  • Inputfield
  • InputfieldsArray
  • InputfieldWrapper
  • Language
  • LanguageParser
  • Languages
  • LanguagesPageFieldValue
  • LanguageSupportInstall
  • LanguageTranslator
  • Markdown_Parser
  • MarkdownExtra_Parser
  • ModuleJS
  • ModulePlaceholder
  • Modules
  • Notice
  • NoticeError
  • NoticeMessage
  • Notices
  • NullPage
  • Page
  • PageArray
  • Pagefile
  • Pagefiles
  • PagefilesManager
  • PageFinder
  • Pageimage
  • Pageimages
  • PagerNav
  • PagerNavItem
  • Pages
  • PagesAccess
  • PagesSortfields
  • PagesType
  • Paths
  • Permission
  • Permissions
  • Process
  • ProcessController
  • ProcessWire
  • Role
  • Roles
  • Sanitizer
  • Selector
  • SelectorBitwiseAnd
  • SelectorContains
  • SelectorContainsLike
  • SelectorContainsWords
  • SelectorEnds
  • SelectorEqual
  • SelectorGreaterThan
  • SelectorGreaterThanEqual
  • SelectorLessThan
  • SelectorLessThanEqual
  • SelectorNotEqual
  • Selectors
  • SelectorStarts
  • Session
  • SessionCSRF
  • SmartyPants_Parser
  • SmartyPantsTypographer_Parser
  • SystemUpdate1
  • Template
  • TemplateFile
  • Templates
  • TemplatesArray
  • Textformatter
  • Textile
  • User
  • Users
  • Wire
  • WireArray
  • WireData
  • WireInput
  • WireInputData
  • WireSaveableItems
  • WireSaveableItemsLookup
  • WireUpload

Interfaces

  • CommentFormInterface
  • CommentListInterface
  • ConfigurableModule
  • FieldtypeLanguageInterface
  • FieldtypePageTitleCompatible
  • HasLookupItems
  • HasRoles
  • InputfieldHasArrayValue
  • Module
  • Saveable
  • TrackChanges

Exceptions

  • ProcessController404Exception
  • ProcessControllerPermissionException
  • Wire404Exception
  • WireDatabaseException
  • WireException
  • WirePermissionException

Functions

  • __
  • _n
  • _x
  • fuel
  • identify_modifier_markdown
  • Markdown
  • mdwp_add_p
  • mdwp_hide_tags
  • mdwp_show_tags
  • mdwp_strip_p
  • ProcessWireClassLoader
  • ProcessWireHostSiteConfig
  • ProcessWireShutdown
  • removeNewlines
  • SmartDashes
  • SmartEllipsis
  • SmartQuotes
  • smarty_modifier_markdown
  • smarty_modifier_smartypants
  • SmartyPants
  • tabIndent
  • unregisterGLOBALS
  • wire
  • wireDecodeJSON
  • wireEncodeJSON
  • wireMkdir
  • Overview
  • Namespace
  • Class
  • Tree
  • Download

Class WireUpload

ProcessWire WireUpload

Saves uploads of single or multiple files, saving them to the destination path. If the destination path does not exist, it will be created.

ProcessWire 2.x Copyright (C) 2010 by Ryan Cramer Licensed under GNU/GPL v2, see LICENSE.TXT

http://www.processwire.com http://www.ryancramer.com

Wire implements TrackChanges
Extended by WireUpload
Located at core/Upload.php
Methods summary
public
# __construct( $name )
public
# execute( )
protected
# getPhpFiles( )

Returns PHP's $_FILES or one constructed from an ajax upload

Returns PHP's $_FILES or one constructed from an ajax upload

protected
# getPhpFilesAjax( )

Handles an ajax file upload and constructs a resulting $_FILES

Handles an ajax file upload and constructs a resulting $_FILES

protected
# isValidExtension( $name )
protected
# isValidUpload( $name, $size, $error )
protected
# checkDestinationPath( )
protected
# getUniqueFilename( $destination )
public
# validateFilename( $value, $extensions = array() )
protected
# saveUpload( $tmp_name, $filename, $ajax = false )
protected
# saveUploadZip( $zipFile )
public
# getCompletedFilenames( )
public
# setTargetFilename( $filename )
protected
# getTargetFilename( $filename )
public
# setOverwriteFilename( $filename )
public static
# setUnzipCommand( $unzipCommand )
public static
# getUnzipCommand( )
public
# setValidExtensions( array $extensions )
public
# setMaxFiles( $maxFiles )
public
# setOverwrite( $overwrite )
public
# setDestinationPath( $destinationPath )
public
# setExtractArchives( $extract = true )
public
# setName( $name )
public
# setLowercase( $lowercase = true )
public this
# error( string $text, flags $flags = 0 )

Record an non-fatal error message in the system-wide notices.

Record an non-fatal error message in the system-wide notices.

This method automatically identifies the error as coming from this class.

Fatal errors should still throw a WireException (or class derived from it)

Parameters

$text
string
$flags
flags
int See Notices::flags

Returns

this
public
# getErrors( $clear = false )
Methods inherited from Wire
_(), ___changed(), __call(), __get(), __toString(), _n(), _x(), addHook(), addHookAfter(), addHookBefore(), addHookProperty(), className(), fuel(), getAllFuel(), getChanges(), getFuel(), getHooks(), isChanged(), isHooked(), message(), removeHook(), resetTrackChanges(), runHooks(), setFuel(), setTrackChanges(), trackChange(), trackChanges(), untrackChange(), useFuel()
Properties summary
protected $name
#
protected $destinationPath
#
protected $maxFiles
#
protected array $completedFilenames array()
#
protected $overwrite
#
protected string $overwriteFilename ''
#
protected boolean $lowercase true
#
protected string $targetFilename ''
#
protected boolean $extractArchives false
#
protected array $validExtensions array()
#
protected array $badExtensions array('php', 'php3', 'phtml', 'exe', 'cfm', 'shtml', 'asp', 'pl', 'cgi', 'sh')
#
protected array $errors array()
#
protected static string $unzipCommand 'unzip -j -qq -n /src/ -x __MACOSX .* -d /dst/'
#
protected array $errorInfo array( UPLOAD_ERR_OK => 'Successful Upload', UPLOAD_ERR_INI_SIZE => 'The uploaded file exceeds the upload_max_filesize directive in php.ini.', UPLOAD_ERR_FORM_SIZE => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.', UPLOAD_ERR_PARTIAL => 'The uploaded file was only partially uploaded.', UPLOAD_ERR_NO_FILE => 'No file was uploaded.', UPLOAD_ERR_NO_TMP_DIR => 'Missing a temporary folder.', UPLOAD_ERR_CANT_WRITE => 'Failed to write file to disk.', UPLOAD_ERR_EXTENSION => 'File upload stopped by extension.' )
#
Properties inherited from Wire
$changes, $defaultHookOptions, $fuel, $hookMethodCache, $localHooks, $staticHooks, $trackChanges, $useFuel
ProcessWire API documentation generated by ApiGen 2.6.0