WordPress\AiClientDependencies\Psr\Http\Message
UploadedFileFactoryInterface::createUploadedFile
Create a new uploaded file.
If a size is not provided it will be determined by checking the size of the file.
Method of the class: UploadedFileFactoryInterface{}
No Hooks.
Returns
UploadedFileInterface.
Usage
$UploadedFileFactoryInterface = new UploadedFileFactoryInterface(); $UploadedFileFactoryInterface->createUploadedFile( $stream, ?int $size, $error, ?string $clientFilename, ?string $clientMediaType ): UploadedFileInterface;
- $stream(StreamInterface) (required)
- Underlying stream representing the
php uploaded file content. . - ?int $size
- .
Default:null - $error(int)
- PHP file upload error.
Default:\UPLOAD_ERR_OK - ?string $clientFilename
- .
Default:null - ?string $clientMediaType
- .
Default:null
Notes
- See: http://php.net/manual/features.file-upload.post-method.php
- See: http://php.net/manual/features.file-upload.errors.php
UploadedFileFactoryInterface::createUploadedFile() UploadedFileFactoryInterface::createUploadedFile code WP 7.0
public function createUploadedFile(StreamInterface $stream, ?int $size = null, int $error = \UPLOAD_ERR_OK, ?string $clientFilename = null, ?string $clientMediaType = null): UploadedFileInterface;