Documentation

UploadedFileFactoryInterface

Table of Contents

createUploadedFile()  : UploadedFileInterface
Create a new uploaded file.

Methods

createUploadedFile()

Create a new uploaded file.

public createUploadedFile(StreamInterface $stream[, int $size = null ][, int $error = UPLOAD_ERR_OK ][, string $clientFilename = null ][, string $clientMediaType = null ]) : UploadedFileInterface

If a size is not provided it will be determined by checking the size of the file.

Parameters
$stream : StreamInterface

Underlying stream representing the uploaded file content.

$size : int = null

in bytes

$error : int = UPLOAD_ERR_OK

PHP file upload error

$clientFilename : string = null

Filename as provided by the client, if any.

$clientMediaType : string = null

Media type as provided by the client, if any.

Tags
see
http://php.net/manual/features.file-upload.post-method.php
see
http://php.net/manual/features.file-upload.errors.php
throws
InvalidArgumentException

If the file resource is not readable.

Return values
UploadedFileInterface

Search results