Methods summary
public
string[]
|
#
GetAccept( )
Get list of allowed file mime-types or file extensions.
All defined file mime-types are checked with finfo PHP extension and checked by
allowed file extensions for defined mime-type.
All defined file extensions are translated internally on server side into mime-types,
then checked with finfo PHP extension and checked by
allowed file extensions for defined mime-type.
Example: $this->accept = ['image/*', 'audio/mp3', '.docx'];
Get list of allowed file mime-types or file extensions.
All defined file mime-types are checked with finfo PHP extension and checked by
allowed file extensions for defined mime-type.
All defined file extensions are translated internally on server side into mime-types,
then checked with finfo PHP extension and checked by
allowed file extensions for defined mime-type.
Example: $this->accept = ['image/*', 'audio/mp3', '.docx'];
Returns
string[]
See
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept
|
public
MvcCore\Ext\Forms\Fields\File |MvcCore\Ext\Forms\Validators\Files
|
#
SetAccept( array $accept = [] )
Set list of allowed file mime-types or file extensions.
All defined file mime-types are checked with finfo PHP extension and checked by
allowed file extensions for defined mime-type.
All defined file extensions are translated internally on server side into mime-types,
then checked with finfo PHP extension and checked by
allowed file extensions for defined mime-type.
Example: $this->accept = ['image/*', 'audio/mp3', '.docx'];
Set list of allowed file mime-types or file extensions.
All defined file mime-types are checked with finfo PHP extension and checked by
allowed file extensions for defined mime-type.
All defined file extensions are translated internally on server side into mime-types,
then checked with finfo PHP extension and checked by
allowed file extensions for defined mime-type.
Example: $this->accept = ['image/*', 'audio/mp3', '.docx'];
Parameters
Returns
See
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept
|
public
string|null
|
#
GetCapture( )
Get boolean attribute indicates that capture of media directly from the
device's sensors using a media capture mechanism is preferred,
such as a webcam or microphone. This HTML attribute is used on mobile devices.
Get boolean attribute indicates that capture of media directly from the
device's sensors using a media capture mechanism is preferred,
such as a webcam or microphone. This HTML attribute is used on mobile devices.
Returns
string|null
See
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-capture
|
public
MvcCore\Ext\Forms\Fields\File |MvcCore\Ext\Forms\Validators\Files
|
#
SetCapture( string|null $capture = 'camera' )
Set boolean attribute indicates that capture of media directly from the
device's sensors using a media capture mechanism is preferred,
such as a webcam or microphone. This HTML attribute is used on mobile devices.
Set boolean attribute indicates that capture of media directly from the
device's sensors using a media capture mechanism is preferred,
such as a webcam or microphone. This HTML attribute is used on mobile devices.
Parameters
Returns
See
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-capture
|
public
string|null
|
#
GetAllowedFileNameChars( )
Get allowed file name characters and characters groups for submit regular expression.
All regular expression special characters will be escaped by addcslashes()
function to create proper regular expression pattern to keep only characters
and characters groups presented in this variable. If there are not defined any
characters, there is used in submit filename sanitization PHP constant:
static::ALLOWED_FILE_NAME_CHARS_DEFAULT ;
Get allowed file name characters and characters groups for submit regular expression.
All regular expression special characters will be escaped by addcslashes()
function to create proper regular expression pattern to keep only characters
and characters groups presented in this variable. If there are not defined any
characters, there is used in submit filename sanitization PHP constant:
static::ALLOWED_FILE_NAME_CHARS_DEFAULT ;
Returns
string|null
|
public
MvcCore\Ext\Forms\Fields\File |MvcCore\Ext\Forms\Validators\Files
|
#
SetAllowedFileNameChars( string|null $allowedFileNameChars )
Set allowed file name characters and characters groups for submit regular expression.
All regular expression special characters will be escaped by addcslashes()
function to create proper regular expression pattern to keep only characters
and characters groups presented in this variable. If there are not defined any
characters, there is used in submit filename sanitization PHP constant:
static::ALLOWED_FILE_NAME_CHARS_DEFAULT ;
Set allowed file name characters and characters groups for submit regular expression.
All regular expression special characters will be escaped by addcslashes()
function to create proper regular expression pattern to keep only characters
and characters groups presented in this variable. If there are not defined any
characters, there is used in submit filename sanitization PHP constant:
static::ALLOWED_FILE_NAME_CHARS_DEFAULT ;
Parameters
Returns
|
public
integer|null
|
#
GetMinCount( )
Get minimum uploaded files count. NULL by default.
This attribute is not HTML5, it's rendered as data-min-count="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Get minimum uploaded files count. NULL by default.
This attribute is not HTML5, it's rendered as data-min-count="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Returns
integer|null
|
public
MvcCore\Ext\Forms\Fields\File |MvcCore\Ext\Forms\Validators\Files
|
#
SetMinCount( integer|null $minCount )
Set minimum uploaded files count. NULL by default.
This attribute is not HTML5, it's rendered as data-min-count="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Set minimum uploaded files count. NULL by default.
This attribute is not HTML5, it's rendered as data-min-count="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Parameters
Returns
|
public
integer|null
|
#
GetMaxCount( )
Get maximum uploaded files count. NULL by default.
This attribute is not HTML5, it's rendered as data-max-count="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Get maximum uploaded files count. NULL by default.
This attribute is not HTML5, it's rendered as data-max-count="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Returns
integer|null
|
public
MvcCore\Ext\Forms\Fields\File |MvcCore\Ext\Forms\Validators\Files
|
#
SetMaxCount( integer|null $maxCount )
Set maximum uploaded files count. NULL by default.
This attribute is not HTML5, it's rendered as data-max-count="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Set maximum uploaded files count. NULL by default.
This attribute is not HTML5, it's rendered as data-max-count="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Parameters
Returns
|
public
integer|null
|
#
GetMinSize( )
Get minimum uploaded file size for one uploaded item in bytes. NULL by default.
This attribute is not HTML5, it's rendered as data-min-size="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Get minimum uploaded file size for one uploaded item in bytes. NULL by default.
This attribute is not HTML5, it's rendered as data-min-size="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Returns
integer|null
|
public
MvcCore\Ext\Forms\Fields\File |MvcCore\Ext\Forms\Validators\Files
|
#
SetMinSize( integer|null $minSize )
Set minimum uploaded file size for one uploaded item in bytes. NULL by default.
You can use integer value or human form string like 1MB .
This attribute is not HTML5, it's rendered as data-min-size="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Set minimum uploaded file size for one uploaded item in bytes. NULL by default.
You can use integer value or human form string like 1MB .
This attribute is not HTML5, it's rendered as data-min-size="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Parameters
Returns
|
public
integer|null
|
#
GetMaxSize( )
Get maximum uploaded file size for one uploaded item in bytes. NULL by default.
This attribute is not HTML5, it's rendered as data-max-size="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Get maximum uploaded file size for one uploaded item in bytes. NULL by default.
This attribute is not HTML5, it's rendered as data-max-size="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Returns
integer|null
|
public
MvcCore\Ext\Forms\Fields\File |MvcCore\Ext\Forms\Validators\Files
|
#
SetMaxSize( integer|string|null $maxSize )
Set maximum uploaded file size for one uploaded item in bytes. NULL by default.
You can use integer value or human form string like 5MB .
This attribute is not HTML5, it's rendered as data-max-size="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Set maximum uploaded file size for one uploaded item in bytes. NULL by default.
You can use integer value or human form string like 5MB .
This attribute is not HTML5, it's rendered as data-max-size="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Fields\File |MvcCore\Ext\Forms\Validators\Files
|
#
SetArchiveMaxItems( integer $archiveMaxItems = 1000 )
Set maximum number of allowed files count inside
single uploaded archive file. If uploaded archive
has more files inside than this number, it's
proclaimed as archive bomb and it's not uploaded.
Default value is 1000 .
Set maximum number of allowed files count inside
single uploaded archive file. If uploaded archive
has more files inside than this number, it's
proclaimed as archive bomb and it's not uploaded.
Default value is 1000 .
Parameters
- $archiveMaxItems
- Default
1000 .
Returns
|
public
integer
|
#
GetArchiveMaxItems( )
Get maximum number of allowed files count inside
single uploaded archive file. If uploaded archive
has more files inside than this number, it's
proclaimed as archive bomb and it's not uploaded.
Default value is 1000 .
Get maximum number of allowed files count inside
single uploaded archive file. If uploaded archive
has more files inside than this number, it's
proclaimed as archive bomb and it's not uploaded.
Default value is 1000 .
Returns
integer
|
public
MvcCore\Ext\Forms\Fields\File |MvcCore\Ext\Forms\Validators\Files
|
#
SetArchiveMaxLevels( integer $archiveMaxLevels = 3 )
Maximum number of allowed ZIP archive levels inside.
If uploaded archive contains another zip archive and
those archive another and another, this is maximum
level for nested ZIP archives. If Archive contains
more levels than this, it's proclaimed as archive
bomb and it's not uploaded. Default value is 3 .
Maximum number of allowed ZIP archive levels inside.
If uploaded archive contains another zip archive and
those archive another and another, this is maximum
level for nested ZIP archives. If Archive contains
more levels than this, it's proclaimed as archive
bomb and it's not uploaded. Default value is 3 .
Parameters
- $archiveMaxLevels
- Default
3 .
Returns
|
public
integer
|
#
GetArchiveMaxLevels( )
Maximum number of allowed ZIP archive levels inside.
If uploaded archive contains another zip archive and
those archive another and another, this is maximum
level for nested ZIP archives. If Archive contains
more levels than this, it's proclaimed as archive
bomb and it's not uploaded. Default value is 3 .
Maximum number of allowed ZIP archive levels inside.
If uploaded archive contains another zip archive and
those archive another and another, this is maximum
level for nested ZIP archives. If Archive contains
more levels than this, it's proclaimed as archive
bomb and it's not uploaded. Default value is 3 .
Returns
integer
|
public
MvcCore\Ext\Forms\Fields\File |MvcCore\Ext\Forms\Validators\Files
|
#
SetArchiveMaxCompressPercentage( float $archiveMaxCompressPercentage = 10.0 )
Set maximum archive compression percentage.
If archive file has lower percentage size
than all archive file items together,
it's proclaimed as archive bomb and it's
not uploaded.
Set maximum archive compression percentage.
If archive file has lower percentage size
than all archive file items together,
it's proclaimed as archive bomb and it's
not uploaded.
Parameters
- $archiveMaxCompressPercentage
- Default
10.0 .
Returns
|
public
float
|
#
GetArchiveMaxCompressPercentage( )
Get maximum archive compression percentage.
If archive file has lower percentage size
than all archive file items together,
it's proclaimed as archive bomb and it's
not uploaded.
Get maximum archive compression percentage.
If archive file has lower percentage size
than all archive file items together,
it's proclaimed as archive bomb and it's
not uploaded.
Returns
float
|
public
MvcCore\Ext\Forms\Fields\File |MvcCore\Ext\Forms\Validators\Files
|
#
SetPngImageMaxWidthHeight( integer $pngImageMaxWidthHeight = 10000 )
PNG image maximum width or maximum height.
PNG images use ZIP compression and that's why
those images could be used as ZIP bombs.
This limit helps to prevent file bombs
based on PNG images. Default value is 10000 .
PNG image maximum width or maximum height.
PNG images use ZIP compression and that's why
those images could be used as ZIP bombs.
This limit helps to prevent file bombs
based on PNG images. Default value is 10000 .
Parameters
- $pngImageMaxWidthHeight
- Default
10.0 .
Returns
|
public
integer
|
#
GetPngImageMaxWidthHeight( )
PNG image maximum width or maximum height.
PNG images use ZIP compression and that's why
those images could be used as ZIP bombs.
This limit helps to prevent file bombs
based on PNG images. Default value is 10000 .
PNG image maximum width or maximum height.
PNG images use ZIP compression and that's why
those images could be used as ZIP bombs.
This limit helps to prevent file bombs
based on PNG images. Default value is 10000 .
Returns
integer
|
public
MvcCore\Ext\Forms\Fields\File |MvcCore\Ext\Forms\Validators\Files
|
#
AddBombScanners( )
Add bomb scanner class(es) to scan uploaded files for file bombs.
All classes in this list must implement interface:
\MvcCore\Ext\Forms\Validators\Files\Validations\IBombScanner .
Add bomb scanner class(es) to scan uploaded files for file bombs.
All classes in this list must implement interface:
\MvcCore\Ext\Forms\Validators\Files\Validations\IBombScanner .
Returns
|
public
MvcCore\Ext\Forms\Fields\File |MvcCore\Ext\Forms\Validators\Files
|
#
SetBombScanners( )
Set bomb scanner class(es) to scan uploaded files for file bombs.
All classes in this list must implement interface:
\MvcCore\Ext\Forms\Validators\Files\Validations\IBombScanner .
Set bomb scanner class(es) to scan uploaded files for file bombs.
All classes in this list must implement interface:
\MvcCore\Ext\Forms\Validators\Files\Validations\IBombScanner .
Returns
|
public
string[]
|
#
GetBombScanners( )
Get bomb scanner class(es) to scan uploaded files for file bombs.
All classes in this list must implement interface:
\MvcCore\Ext\Forms\Validators\Files\Validations\IBombScanner .
Get bomb scanner class(es) to scan uploaded files for file bombs.
All classes in this list must implement interface:
\MvcCore\Ext\Forms\Validators\Files\Validations\IBombScanner .
Returns
string[]
|
Properties summary
protected
string[]
|
$accept
List of allowed file mimetypes or file extensions.
All defined file mimetypes are checked with finfo PHP extension and checked by
allowed file extensions for defined mimetype.
All defined file extensions are translated internally on server side into mimetypes,
then checked with finfo PHP extension and checked by
allowed file extensions for defined mimetype.
Example: $this->accept = ['image/*', 'audio/mp3', '.docx'];
List of allowed file mimetypes or file extensions.
All defined file mimetypes are checked with finfo PHP extension and checked by
allowed file extensions for defined mimetype.
All defined file extensions are translated internally on server side into mimetypes,
then checked with finfo PHP extension and checked by
allowed file extensions for defined mimetype.
Example: $this->accept = ['image/*', 'audio/mp3', '.docx'];
See
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept
|
|
protected
string|null
|
$capture
Boolean attribute indicates that capture of media directly from the
device's sensors using a media capture mechanism is preferred,
such as a webcam or microphone. This HTML attribute is used on mobile devices.
Boolean attribute indicates that capture of media directly from the
device's sensors using a media capture mechanism is preferred,
such as a webcam or microphone. This HTML attribute is used on mobile devices.
See
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-capture
https://www.w3.org/TR/html-media-capture/#dfn-media-capture-mechanism
|
|
protected
string|null
|
$allowedFileNameChars
Allowed file name characters and characters groups for submit regular expression.
All regular expression special characters will be escaped by addcslashes()
function to create proper regular expression pattern to keep only characters
and characters groups presented in this variable. If there are not defined any
characters, there is used in submit filename sanitization PHP constant:
static::ALLOWED_FILE_NAME_CHARS_DEFAULT ;
Allowed file name characters and characters groups for submit regular expression.
All regular expression special characters will be escaped by addcslashes()
function to create proper regular expression pattern to keep only characters
and characters groups presented in this variable. If there are not defined any
characters, there is used in submit filename sanitization PHP constant:
static::ALLOWED_FILE_NAME_CHARS_DEFAULT ;
|
|
protected
integer|null
|
$minCount
Minimum uploaded files count. NULL by default.
This attribute is not HTML5, it's rendered as data-min-count="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Minimum uploaded files count. NULL by default.
This attribute is not HTML5, it's rendered as data-min-count="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
|
|
protected
integer|null
|
$maxCount
Maximum uploaded files count. NULL by default.
This attribute is not HTML5, it's rendered as data-max-count="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Maximum uploaded files count. NULL by default.
This attribute is not HTML5, it's rendered as data-max-count="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
|
|
protected
integer|null
|
$minSize
Minimum uploaded file size for one uploaded item in bytes. NULL by default.
This attribute is not HTML5, it's rendered as data-min-size="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Minimum uploaded file size for one uploaded item in bytes. NULL by default.
This attribute is not HTML5, it's rendered as data-min-size="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
|
|
protected
integer|null
|
$maxSize
Maximum uploaded file size for one uploaded item in bytes. NULL by default.
This attribute is not HTML5, it's rendered as data-max-size="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
Maximum uploaded file size for one uploaded item in bytes. NULL by default.
This attribute is not HTML5, it's rendered as data-max-size="..." .
Attribute is not used on client side by default, but you can do it, it's
only checked if attribute is not NULL in submit processing.
|
|
protected
integer
|
$archiveMaxItems
Maximum number of allowed files count inside
single uploaded archive file. If uploaded archive
has more files inside than this number, it's
proclaimed as archive bomb and it's not uploaded.
Default value is 1000 .
Maximum number of allowed files count inside
single uploaded archive file. If uploaded archive
has more files inside than this number, it's
proclaimed as archive bomb and it's not uploaded.
Default value is 1000 .
|
|
protected
integer
|
$archiveMaxLevels
Maximum number of allowed ZIP archive levels inside.
If uploaded archive contains another zip archive and
those archive another and another, this is maximum
level for nested ZIP archives. If Archive contains
more levels than this, it's proclaimed as archive
bomb and it's not uploaded. Default value is 3 .
Maximum number of allowed ZIP archive levels inside.
If uploaded archive contains another zip archive and
those archive another and another, this is maximum
level for nested ZIP archives. If Archive contains
more levels than this, it's proclaimed as archive
bomb and it's not uploaded. Default value is 3 .
|
|
protected
float
|
$archiveMaxCompressPercentage
Maximum archive compression percentage.
If archive file has lower percentage size
than all archive file items together,
it's proclaimed as archive bomb and it's
not uploaded. Default value is 10000 .
Maximum archive compression percentage.
If archive file has lower percentage size
than all archive file items together,
it's proclaimed as archive bomb and it's
not uploaded. Default value is 10000 .
|
|
protected
integer
|
$pngImageMaxWidthHeight
PNG image maximum width or maximum height.
PNG images use ZIP compression and that's why
those images could be used as ZIP bombs.
This limit helps to prevent file bombs
based on PNG images.
PNG image maximum width or maximum height.
PNG images use ZIP compression and that's why
those images could be used as ZIP bombs.
This limit helps to prevent file bombs
based on PNG images.
|
|
protected
string[]
|
$bombScanners
Bomb scanner classes to scan uploaded files for file bombs.
All classes in this list must implement interface:
\MvcCore\Ext\Forms\Validators\Files\Validations\IBombScanner .
Bomb scanner classes to scan uploaded files for file bombs.
All classes in this list must implement interface:
\MvcCore\Ext\Forms\Validators\Files\Validations\IBombScanner .
|
#
[
'\\MvcCore\\Ext\\Forms\\Validators\\Files\\Validations\\BombScanners\\ZipArchive',
'\\MvcCore\\Ext\\Forms\\Validators\\Files\\Validations\\BombScanners\\PngImage',
'\\MvcCore\\Ext\\Forms\\Validators\\Files\\Validations\\BombScanners\\GzArchive'
]
|