UploadedFile Class

Aurora\Http Namespace

Interfaces

  • I UploadedFileInterface

Properties

errors

Error array

protected static $errors = []: array

clientFilename
protected $clientFilename = '': string

clientMediaType
protected $clientMediaType = '': string

error
protected $error = 0: int

moved
protected $moved = : bool

file
protected $file: mixed

size
protected $size = 0: int

stream
protected $stream: \StreamInterface

Constructor

__construct

Constructor

Parameters

  • mixed $streamOrFile — Stream or file
  • mixed $size — Size
  • mixed $errorStatus — Error code
  • mixed $clientFilename — Client file name
  • mixed $clientMediaType — Client media type

Signature

public function __construct(mixed $streamOrFile, mixed $size, mixed $errorStatus, mixed $clientFilename, mixed $clientMediaType)

Methods

__construct

Constructor

Parameters

  • mixed $streamOrFile — Stream or file
  • mixed $size — Size
  • mixed $errorStatus — Error code
  • mixed $clientFilename — Client file name
  • mixed $clientMediaType — Client media type

Signature

public function __construct(mixed $streamOrFile, mixed $size, mixed $errorStatus, mixed $clientFilename, mixed $clientMediaType)

getStream

Retrieve a stream representing the uploaded file

Return Value

  • \StreamInterface Stream representation of the uploaded file

Signature

public function getStream()

moveTo

Move the uploaded file to a new location

Parameters

  • mixed $targetPath — Path to which to move the uploaded file

Signature

public function moveTo(mixed $targetPath)

getSize

Retrieve the file size

Return Value

  • mixed The file size in bytes

Signature

public function getSize()

getError

Retrieve the error associated with the uploaded file

Return Value

  • int One of PHP's UPLOAD_ERR_XXX constants

Signature

public function getError()

getClientFilename

Retrieve the filename sent by the client

Return Value

  • mixed The filename sent by the client

Signature

public function getClientFilename()

getClientMediaType

Retrieve the media type sent by the client

Return Value

  • mixed The media type sent by the client

Signature

public function getClientMediaType()

check

Check the file status

Signature

protected function check()

Go to top