Webylon 3.2 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
  • Download
Version: current
  • 3.2
  • 3.1

Packages

  • 1c
    • exchange
      • catalog
  • auth
  • Booking
  • building
    • company
  • cart
    • shipping
    • steppedcheckout
  • Catalog
    • monument
  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • newsletter
    • publishers
    • reports
    • security
    • tasks
  • Dashboard
  • DataObjectManager
  • event
  • faq
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • googlesitemaps
  • guestbook
  • installer
  • newsletter
  • None
  • photo
    • gallery
  • PHP
  • polls
  • recaptcha
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets
  • seo
    • open
      • graph
  • sfDateTimePlugin
  • spamprotection
  • stealth
    • captha
  • subsites
  • userform
    • pagetypes
  • userforms
  • webylon
  • widgets

Classes

  • Archive
  • File
  • Filesystem
  • FlushGeneratedImagesTask
  • FLV
  • Folder
  • Folder_UnusedAssetsField
  • GD
  • Image
  • Image_Cached
  • MediawebPage_Image
  • MP3
  • SaveFileSizeTask
  • TarballArchive
  • Upload
  • Upload_Validator
  • VideoFile

Class Upload_Validator

Package: sapphire\filesystem
Located at sapphire/filesystem/Upload.php

Methods summary

public array
# getErrors( )

Return all errors that occurred while validating the temporary file.

Return all errors that occurred while validating the temporary file.

Returns

array
array
public
# setTmpFile( array $tmpFile )

Set information about temporary file produced by PHP.

Set information about temporary file produced by PHP.

Parameters

$tmpFile
array $tmpFile
public integer
# getAllowedMaxFileSize( string $ext = null )

Get maximum file size for all or specified file extension.

Get maximum file size for all or specified file extension.

Parameters

$ext
string $ext

Returns

integer
Filesize in bytes
public
# setAllowedMaxFileSize( array|integer $rules )

Set filesize maximums (in bytes). Automatically converts extensions to lowercase for easier matching.

Set filesize maximums (in bytes). Automatically converts extensions to lowercase for easier matching.

Example:

array('*' => 200, 'jpg' => 1000)

Parameters

$rules
array|int $rules
public array
# getAllowedExtensions( )

Returns

array
array
public
# setAllowedExtensions( array $rules )

Parameters

$rules
array $rules
public boolean
# isValidSize( )

Determines if the bytesize of an uploaded file is valid - can be defined on an extension-by-extension basis in {$allowedMaxFileSize}

Determines if the bytesize of an uploaded file is valid - can be defined on an extension-by-extension basis in {$allowedMaxFileSize}

Returns

boolean
boolean
public boolean
# isValidExtension( )

Determines if the temporary file has a valid extension An empty string in the validation map indicates files without an extension.

Determines if the temporary file has a valid extension An empty string in the validation map indicates files without an extension.

Returns

boolean
boolean
public boolean
# validate( )

Run through the rules for this validator checking against the temporary file set by Upload_Validator::setTmpFile() to see if the file is deemed valid or not.

Run through the rules for this validator checking against the temporary file set by Upload_Validator::setTmpFile() to see if the file is deemed valid or not.

Returns

boolean
boolean

Magic methods summary

Properties summary

protected array $tmpFile
#

Information about the temporary file produced by the PHP-runtime.

Information about the temporary file produced by the PHP-runtime.

protected array $errors
#
public array $allowedMaxFileSize
#

Restrict filesize for either all filetypes or a specific extension, with extension-name as array-key and the size-restriction in bytes as array-value.

Restrict filesize for either all filetypes or a specific extension, with extension-name as array-key and the size-restriction in bytes as array-value.

public array $allowedExtensions
#

Collection of extensions. Extension-names are treated case-insensitive.

Example:

array("jpg","GIF")

Collection of extensions. Extension-names are treated case-insensitive.

Example:

array("jpg","GIF")
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -
Webylon 3.2 API Docs API documentation generated by ApiGen 2.8.0