UploadedFile
in package
FinalYes
Table of Contents
Constants
- BLOCKED_EXTENSIONS = ['phar', 'php', 'php3', 'php4', 'php5', 'php7', 'php8', 'pht', 'phtml', 'phps']
- IMAGE_EXTENSIONS = ['gif', 'jpeg', 'jpg', 'png', 'webp']
- IMAGE_MIME_TYPES = ['image/gif', 'image/jpeg', 'image/png', 'image/webp']
Properties
Methods
- __construct() : mixed
- extension() : string
- getClientMimeType() : string
- getClientOriginalExtension() : string
- getClientOriginalName() : string
- getErrorMessage() : string
- getMaxFilesize() : int
- getMimeType() : string
- getPathname() : string
- getRealPath() : string
- getSize() : int
- isUploaded() : bool
- isValid() : bool
- isValidImage() : bool
- move() : bool
- moveTo() : bool
- hasBlockedExtension() : bool
- parseFilesize() : int
Constants
BLOCKED_EXTENSIONS
private
mixed
BLOCKED_EXTENSIONS
= ['phar', 'php', 'php3', 'php4', 'php5', 'php7', 'php8', 'pht', 'phtml', 'phps']
IMAGE_EXTENSIONS
private
mixed
IMAGE_EXTENSIONS
= ['gif', 'jpeg', 'jpg', 'png', 'webp']
IMAGE_MIME_TYPES
private
mixed
IMAGE_MIME_TYPES
= ['image/gif', 'image/jpeg', 'image/png', 'image/webp']
Properties
$error
public
int
$error
$name
public
string
$name
$size
public
int
$size
$test
public
bool
$test
= false
$tmp_name
public
string
$tmp_name
$type
public
string
$type
Methods
__construct()
public
__construct([array<string|int, mixed> $data = [] ]) : mixed
Parameters
- $data : array<string|int, mixed> = []
extension()
public
extension() : string
Return values
stringgetClientMimeType()
public
getClientMimeType() : string
Return values
stringgetClientOriginalExtension()
public
getClientOriginalExtension() : string
replaced by extension() method
Return values
stringgetClientOriginalName()
public
getClientOriginalName() : string
Return values
stringgetErrorMessage()
public
getErrorMessage() : string
Return values
stringgetMaxFilesize()
public
static getMaxFilesize() : int
Return values
intgetMimeType()
public
getMimeType() : string
Return values
stringgetPathname()
public
getPathname() : string
Return values
stringgetRealPath()
public
getRealPath() : string
Return values
stringgetSize()
public
getSize() : int
Return values
intisUploaded()
public
isUploaded() : bool
Return values
boolisValid()
public
isValid() : bool
Return values
boolisValidImage()
public
isValidImage() : bool
Return values
boolmove()
public
move(string $destiny, string $destinyName) : bool
Parameters
- $destiny : string
- $destinyName : string
Return values
boolmoveTo()
public
moveTo(string $targetPath) : bool
Parameters
- $targetPath : string
Return values
boolhasBlockedExtension()
private
hasBlockedExtension() : bool
Return values
boolparseFilesize()
private
static parseFilesize(string $size) : int
Parameters
- $size : string