function UploadedFileFactoryInterface::createUploadedFile
Create a new uploaded file.
If a size is not provided it will be determined by checking the size of the file.
Parameters
StreamInterface $stream Underlying stream representing the: uploaded file content.
int|null $size in bytes:
int $error PHP file upload error:
string|null $clientFilename Filename as provided by the client, if any.:
string|null $clientMediaType Media type as provided by the client, if any.:
Return value
Throws
\InvalidArgumentException If the file resource is not readable.
See also
http://php.net/manual/features.file-upload.post-method.php
http://php.net/manual/features.file-upload.errors.php
2 methods override UploadedFileFactoryInterface::createUploadedFile()
- HttpFactory::createUploadedFile in vendor/
guzzlehttp/ psr7/ src/ HttpFactory.php - Create a new uploaded file.
- Psr17Factory::createUploadedFile in vendor/
php-http/ discovery/ src/ Psr17Factory.php - Create a new uploaded file.
File
-
vendor/
psr/ http-factory/ src/ UploadedFileFactoryInterface.php, line 27
Class
Namespace
Psr\Http\MessageCode
public function createUploadedFile(StreamInterface $stream, ?int $size = null, int $error = \UPLOAD_ERR_OK, ?string $clientFilename = null, ?string $clientMediaType = null) : UploadedFileInterface;