Interface IFiles
Responsibility: Validate everything necessary for uploaded files and check files by accept
attribute rules by magic bytes.
Direct known implementers
MvcCore\Ext\Forms\Validators\FilesSee: http://php.net/manual/en/features.file-upload.php
See: http://php.net/manual/en/features.file-upload.common-pitfalls.php
Located at ext-form-field-file/src/MvcCore/Ext/Forms/Validators/IFiles.php
public
|
#
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 |
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 |
public
|
#
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 |
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 |
public
|
#
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. |
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. |
public
|
#
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 |
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 |
public
|
#
AddBombScanners( )
Add bomb scanner class(es) to scan uploaded files for file bombs.
All classes in this list must implement interface:
|
public
|
#
SetBombScanners( )
Set bomb scanner class(es) to scan uploaded files for file bombs.
All classes in this list must implement interface:
|
public
string[]
|
#
GetBombScanners( )
Get bomb scanner class(es) to scan uploaded files for file bombs.
All classes in this list must implement interface:
|
public
string
|
string |
WIN_RESERVED_FILENAMES
|
#
'CON,PRN,AUX,NUL,COM1,COM2,COM3,COM4,COM5,COM6,COM7,COM8,COM9,LPT1,LPT2,LPT3,LPT4,LPT5,LPT6,LPT7,LPT8,LPT9'
|
string |
MVCCORE_EXT_TOOLS_MIMES_EXTS_CLASS
MvcCore extension class nam to get mimetype by file extension and backwards. |
#
'\\MvcCore\\Ext\\Tools\\MimeTypesExtensions'
|
integer |
UPLOAD_ERR_MIN_FILES
|
#
9
|
integer |
UPLOAD_ERR_MAX_FILES
|
#
10
|
integer |
UPLOAD_ERR_NOT_POSTED
|
#
11
|
integer |
UPLOAD_ERR_NOT_FILE
|
#
12
|
integer |
UPLOAD_ERR_EMPTY_FILE
|
#
13
|
integer |
UPLOAD_ERR_TOO_LARGE_FILE
|
#
14
|
integer |
UPLOAD_ERR_MIN_SIZE
|
#
15
|
integer |
UPLOAD_ERR_MAX_SIZE
|
#
16
|
integer |
UPLOAD_ERR_NO_FILEINFO
|
#
17
|
integer |
UPLOAD_ERR_NO_MIMES_EXT
|
#
18
|
integer |
UPLOAD_ERR_UNKNOWN_ACCEPT
|
#
19
|
integer |
UPLOAD_ERR_UNKNOWN_EXT
|
#
20
|
integer |
UPLOAD_ERR_UNKNOWN_MIME
|
#
21
|
integer |
UPLOAD_ERR_RESERVED_NAME
|
#
22
|
integer |
UPLOAD_ERR_NOT_ACCEPTED
|
#
23
|
integer |
UPLOAD_ERR_FILE_BOMB
|
#
24
|