This is automatic generated document for things in Swow\Psr7\Message\UploadedFile class

Class UploadedFile

PSR-7 UploadedFile implementation (https://github.com/Nyholm/psr7/blob/master/src/UploadedFile.php)

Constants

protected ERRORS = {"0":true,"1":true,"2":true,"3":true,"4":true,"6":true,"7":true,"8":true} public TMP_FILE_PREFIX = "swow_uploaded_file_"

Properties

protected $clientFilename protected $clientMediaType protected $error protected $file protected $moved protected $size protected $stream protected $temporary

Methods

Method __construct

public function __construct ( (string | resource | StreamInterface) $streamOrFile , ?int $size , int $error , ?string $clientFilename , ?string $clientMediaType )

Method __destruct

public function __destruct ( )

Method getClientFilename

public function getClientFilename ( ) : ?string

Method getClientMediaType

public function getClientMediaType ( ) : ?string

Method getError

public function getError ( ) : int

Method getExtension

public function getExtension ( ) : string

Method getSize

public function getSize ( ) : ?int

Method getStream

public function getStream ( ) : StreamInterface

Method isMoved

public function isMoved ( ) : bool

Method moveTo

public function moveTo ( mixed $targetPath ) : void

Method setTemporaryFile

public function setTemporaryFile ( bool $temporary ) : static

Mark the file as storage that the request parser created for this upload, so that the object removes it when the object dies. A file handed in by the caller stays, whatever its location is.

Method toArray

public function toArray ( ) : array{name: (string | null), type: (string | null), tmp_file: (string | null), error: int, size: (int | false)}

Method validateActive

protected function validateActive ( ) : void

Throws RuntimeException if is moved or not ok


Copyright 2022 the Swow contributors

This site uses Just the Docs, a documentation theme for Jekyll.