implements |
UploadedFileInterface |
---|
A PSR-7 uploaded file (incoming, server-side)
Methods | ||
---|---|---|
public
|
__construct(
StreamInterface|resource|string $resource,
?int $size = null,
int $error = UPLOAD_ERR_OK,
?string $clientFilename = null,
?string $clientMediaType = null,
)
|
# |
public
|
getStream(): StreamInterface
|
# |
public
|
moveTo(string $targetPath): void
|
# |
public
|
getSize(): ?int
|
# |
public
|
getError(): int
|
# |
public
|
getClientFilename(): ?string
|
# |
public
|
getClientMediaType(): ?string
|
# |
Constants | ||
---|---|---|
protected
|
ERROR_MESSAGE = [
UPLOAD_ERR_OK => 'There is no error, the file uploaded with success',
UPLOAD_ERR_INI_SIZE => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
UPLOAD_ERR_FORM_SIZE => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
UPLOAD_ERR_PARTIAL => 'The uploaded file was only partially uploaded',
UPLOAD_ERR_NO_FILE => 'No file was uploaded',
UPLOAD_ERR_NO_TMP_DIR => 'Missing a temporary folder',
UPLOAD_ERR_CANT_WRITE => 'Failed to write file to disk',
UPLOAD_ERR_EXTENSION => 'A PHP extension stopped the file upload',
]
|
# |
Properties | |||
---|---|---|---|
protected
|
StreamInterface
|
$Stream
|
# |
protected
|
string
|
$File
|
# |
protected
|
?int
|
$Size
|
# |
protected
|
int
|
$Error
|
# |
protected
|
?string
|
$ClientFilename
|
# |
protected
|
?string
|
$ClientMediaType
|
# |