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
|
#
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
|
#
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:
\MvcCore\Ext\Forms\Validators\Files::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:
\MvcCore\Ext\Forms\Validators\Files::ALLOWED_FILE_NAME_CHARS_DEFAULT ;
Returns
string|null
|
public
MvcCore\Ext\Forms\Fields\File
|
#
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:
\MvcCore\Ext\Forms\Validators\Files::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:
\MvcCore\Ext\Forms\Validators\Files::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
|
#
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
|
#
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
|
#
SetMinSize( integer|null $minSize )
Set 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.
Set 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.
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
|
#
SetMaxSize( integer|null $maxSize )
Set 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.
Set 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.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Fields\File
|
#
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
|
#
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
|
#
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
|
#
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
|
#
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
|
#
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[]
|