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

Breadcrumb

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

function UploadedFileInterface::getStream

Retrieve a stream representing the uploaded file.

This method MUST return a StreamInterface instance, representing the uploaded file. The purpose of this method is to allow utilizing native PHP stream functionality to manipulate the file upload, such as stream_copy_to_stream() (though the result will need to be decorated in a native PHP stream wrapper to work with such functions).

If the moveTo() method has been called previously, this method MUST raise an exception.

Return value

StreamInterface Stream representation of the uploaded file.

Throws

\RuntimeException in cases when no stream is available or can be created.

1 method overrides UploadedFileInterface::getStream()
UploadedFile::getStream in vendor/guzzlehttp/psr7/src/UploadedFile.php
Retrieve a stream representing the uploaded file.

File

vendor/psr/http-message/src/UploadedFileInterface.php, line 31

Class

UploadedFileInterface
Value object representing a file uploaded through an HTTP request.

Namespace

Psr\Http\Message

Code

public function getStream() : StreamInterface;

API Navigation

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