Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UploadedFileFactoryInterface.php

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

UploadedFileInterface

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

UploadedFileFactoryInterface

Namespace

Psr\Http\Message

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal