\Puyo\Psr7UploadedFile

PSR-7 の UploadedFileInterface の実装

アップロードされたファイル1件の抽象化。

Summary

Methods
Properties
Constants
__construct()
createBy_FILE()
getStream()
moveTo()
getSize()
getError()
getClientFilename()
getClientMediaType()
isUploadOk()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
writeFile()
$clientFilename
$clientMediaType
$errorCode
$file
$moved
$size
$stream
N/A

Properties

$clientFilename

$clientFilename : string

Type

string

$clientMediaType

$clientMediaType : string

Type

string

$errorCode

$errorCode : integer

Type

integer

$file

$file : string|null

Type

string|null

$moved

$moved : boolean

Type

boolean

$size

$size : integer

Type

integer

$stream

$stream : \Psr\Http\Message\StreamInterface

Type

\Psr\Http\Message\StreamInterface

Methods

__construct()

__construct(string|resource|\Psr\Http\Message\StreamInterface  $streamOrFile, integer  $size, integer  $errorCode, string  $clientFilename = null, string  $clientMediaType = null) 

Parameters

string|resource|\Psr\Http\Message\StreamInterface $streamOrFile
integer $size

UPLOADERR* constant

integer $errorCode
string $clientFilename
string $clientMediaType

createBy_FILE()

createBy_FILE(array  $file) : \Puyo\Psr7\UploadedFile

$_FILES の1件分から作成する

Parameters

array $file

Returns

\Puyo\Psr7\UploadedFile

getStream()

getStream() : \Psr\Http\Message\StreamInterface

{@inheritdoc}

Throws

\RuntimeException

if the upload was not successful.

Returns

\Psr\Http\Message\StreamInterface

moveTo()

moveTo(string  $targetPath) 

{@inheritdoc}

Parameters

string $targetPath

getSize()

getSize() : integer

{@inheritdoc}

Returns

integer

getError()

getError() : integer

{@inheritdoc}

Returns

integer

getClientFilename()

getClientFilename() : string

{@inheritdoc}

Returns

string

getClientMediaType()

getClientMediaType() : string

{@inheritdoc}

Returns

string

isUploadOk()

isUploadOk() : boolean

アップロードが正常に完了したかどうかを返す

Returns

boolean

writeFile()

writeFile(  $path) 

Parameters

$path