UploadedFile
in package
implements
UploadedFileInterface
Implements an uploaded file object
Table of Contents
Interfaces
- UploadedFileInterface
Constants
- UPLOAD_ERRORS = [\UPLOAD_ERR_OK, \UPLOAD_ERR_INI_SIZE, \UPLOAD_ERR_FORM_SIZE, \UPLOAD_ERR_PARTIAL, \UPLOAD_ERR_NO_FILE, \UPLOAD_ERR_NO_TMP_DIR, \UPLOAD_ERR_CANT_WRITE, \UPLOAD_ERR_EXTENSION]
Properties
- $error : int
- $file : string|null
- $filename : string|null
- $mediaType : string|null
- $moved : bool
- $size : int
- $stream : StreamInterface|null
- $streamFactory : StreamFactoryInterface
Methods
- __construct() : mixed
- getClientFilename() : string|null
- getClientMediaType() : string|null
- getError() : int
- getSize() : int|null
- getStream() : StreamInterface
- moveTo() : void
- copyToStream() : void
- Copy the contents of a stream into another stream until the given number of bytes have been read.
- validateActive() : void
Constants
UPLOAD_ERRORS
public
array<string|int, int>
UPLOAD_ERRORS
= [\UPLOAD_ERR_OK, \UPLOAD_ERR_INI_SIZE, \UPLOAD_ERR_FORM_SIZE, \UPLOAD_ERR_PARTIAL, \UPLOAD_ERR_NO_FILE, \UPLOAD_ERR_NO_TMP_DIR, \UPLOAD_ERR_CANT_WRITE, \UPLOAD_ERR_EXTENSION]
Properties
$error
protected
int
$error
$file
protected
string|null
$file
= null
$filename
protected
string|null
$filename
= null
$mediaType
protected
string|null
$mediaType
= null
$moved
protected
bool
$moved
= false
$size
protected
int
$size
$stream
protected
StreamInterface|null
$stream
$streamFactory
protected
StreamFactoryInterface
$streamFactory
Methods
__construct()
public
__construct(mixed $file, int $size[, int $error = UPLOAD_ERR_OK ][, string|null $filename = null ][, string|null $mediaType = null ][, StreamFactoryInterface $streamFactory = new HTTPFactory() ]) : mixed
Parameters
- $file : mixed
- $size : int
- $error : int = UPLOAD_ERR_OK
- $filename : string|null = null
- $mediaType : string|null = null
- $streamFactory : StreamFactoryInterface = new HTTPFactory()
Tags
getClientFilename()
public
getClientFilename() : string|null
Return values
string|nullgetClientMediaType()
public
getClientMediaType() : string|null
Return values
string|nullgetError()
public
getError() : int
Return values
intgetSize()
public
getSize() : int|null
Return values
int|nullgetStream()
public
getStream() : StreamInterface
Return values
StreamInterfacemoveTo()
public
moveTo(string $targetPath) : void
Parameters
- $targetPath : string
copyToStream()
Copy the contents of a stream into another stream until the given number of bytes have been read.
protected
copyToStream(StreamInterface $dest) : void
Parameters
- $dest : StreamInterface
Tags
validateActive()
protected
validateActive() : void