UploadReceiver
trait UploadReceiver
Represents a form field which has an Upload() instance and can upload to a folder
Note that this trait expects to be applied to a {see FormField} class
Methods
Limit allowed file extensions. Empty by default, allowing all extensions.
Limit allowed file extensions by specifying categories of file types.
Returns list of extensions allowed by this field, or an empty array if there is no restriction
Get custom validator for this field
Sets the upload folder name
Gets the upload folder name
Details
at line 60
Upload
getUpload()
Retrieves the Upload handler
at line 71
$this
setUpload(Upload $upload)
Sets the upload handler
at line 87
$this
setAllowedExtensions(array $rules)
Limit allowed file extensions. Empty by default, allowing all extensions.
To allow files without an extension, use an empty string. See {@link File::$allowed_extensions} to get a good standard set of extensions that are typically not harmful in a webserver context. See {@link setAllowedMaxFileSize()} to limit file size by extension.
at line 103
$this
setAllowedFileCategories($category)
Limit allowed file extensions by specifying categories of file types.
These may be 'image', 'image/supported', 'audio', 'video', 'archive', 'flash', or 'document' See {@link File::$allowed_extensions} for details of allowed extensions for each of these categories
at line 115
array
getAllowedExtensions()
Returns list of extensions allowed by this field, or an empty array if there is no restriction
at line 125
Upload_Validator
getValidator()
Get custom validator for this field
at line 136
$this
setValidator(Upload_Validator $validator)
Set custom validator for this field
at line 148
$this
setFolderName(string $folderName)
Sets the upload folder name
at line 159
string
getFolderName()
Gets the upload folder name