RequestedFile
in package
Requested File Class
Represents a file sent in a request. Read-only.
Table of Contents
Properties
- $binary : string
- $error : string
- $ext : string
- $isValid : bool
- $mimetype : string
- $name : string
- $size : int
- $temporary : string
Methods
- __construct() : mixed
- Constructor.
- __destruct() : mixed
- Destructor.
- __get() : mixed
- Magic getter method.
- MoveTo() : void
- Moves the temporary file to the specified directory.
Properties
$binary
public
string
$binary
Binary content of the file.
$error
public
string
$error
The error message, if any.
$ext
public
string
$ext
The extension of the file.
$isValid
public
bool
$isValid
Indicates whether the file is valid.
$mimetype
public
string
$mimetype
The MIME type of the file.
$name
public
string
$name
The name of the file.
$size
public
int
$size
The size of the file in bytes.
$temporary
public
string
$temporary
The path to the temporary file.
Methods
__construct()
Constructor.
public
__construct(array<string|int, mixed>|object $arrFILE) : mixed
Parameters
- $arrFILE : array<string|int, mixed>|object
-
The $_FILE array or object.
__destruct()
Destructor.
public
__destruct() : mixed
__get()
Magic getter method.
public
__get(string $prop) : mixed
Parameters
- $prop : string
-
The property name.
Return values
mixed —The value of the property.
MoveTo()
Moves the temporary file to the specified directory.
public
MoveTo(string $path[, int $mode = 0777 ]) : void
Parameters
- $path : string
-
The destination path.
- $mode : int = 0777
-
The permissions to set for the file (default: 0777).