Documentation

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

$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
throws
InvalidArgumentException

getClientFilename()

public getClientFilename() : string|null
Return values
string|null

getClientMediaType()

public getClientMediaType() : string|null
Return values
string|null

getSize()

public getSize() : int|null
Return values
int|null

getStream()

public getStream() : StreamInterface
Return values
StreamInterface

moveTo()

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
author

Michael Dowling and contributors to guzzlehttp/psr7

throws
RuntimeException

on error

validateActive()

protected validateActive() : void
Tags
throws
RuntimeException

if is moved or not ok


        
On this page

Search results