WordPress\AiClientDependencies\Psr\Http\Message

UploadedFileFactoryInterface::createUploadedFile │ public │ WP 1.0

Create a new uploaded file.

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

Метод класса: UploadedFileFactoryInterface{}

Хуков нет.

Возвращает

UploadedFileInterface.

Использование

$UploadedFileFactoryInterface = new UploadedFileFactoryInterface();
$UploadedFileFactoryInterface->createUploadedFile( $stream, ?int $size, $error, ?string $clientFilename, ?string $clientMediaType ): UploadedFileInterface;
$stream(StreamInterface) (обязательный)
Underlying stream representing the
php uploaded file content. .
?int $size
.
По умолчанию: null
$error(int)
PHP file upload error.
По умолчанию: \UPLOAD_ERR_OK
?string $clientFilename
.
По умолчанию: null
?string $clientMediaType
.
По умолчанию: null

Заметки

Смотрите: http://php.net/manual/features.file-upload.post-method.php
Смотрите: http://php.net/manual/features.file-upload.errors.php

Код UploadedFileFactoryInterface::createUploadedFile() WP 7.1.2

public function createUploadedFile(StreamInterface $stream, ?int $size = null, int $error = \UPLOAD_ERR_OK, ?string $clientFilename = null, ?string $clientMediaType = null): UploadedFileInterface;