PHP Class Zend\Diactoros\UploadedFile

Inheritance: implements Psr\Http\Message\UploadedFileInterface
Show file Open project: zendframework/zend-diactoros

Public Methods

Method Description
__construct ( string | resource $streamOrFile, integer $size, integer $errorStatus, string | null $clientFilename = null, string | null $clientMediaType = null )
getClientFilename ( ) : string | null
getClientMediaType ( )
getError ( ) : integer
getSize ( ) : integer | null
getStream ( )
moveTo ( string $targetPath )

Private Methods

Method Description
writeFile ( string $path ) Write internal stream to given path

Method Details

__construct() public method

public __construct ( string | resource $streamOrFile, integer $size, integer $errorStatus, string | null $clientFilename = null, string | null $clientMediaType = null )
$streamOrFile string | resource
$size integer
$errorStatus integer
$clientFilename string | null
$clientMediaType string | null

getClientFilename() public method

public getClientFilename ( ) : string | null
return string | null The filename sent by the client or null if none was provided.

getClientMediaType() public method

public getClientMediaType ( )

getError() public method

See also: http://php.net/manual/en/features.file-upload.errors.php
public getError ( ) : integer
return integer One of PHP's UPLOAD_ERR_XXX constants.

getSize() public method

public getSize ( ) : integer | null
return integer | null The file size in bytes or null if unknown.

getStream() public method

public getStream ( )

moveTo() public method

See also: http://php.net/is_uploaded_file
See also: http://php.net/move_uploaded_file
public moveTo ( string $targetPath )
$targetPath string Path to which to move the uploaded file.