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

Breadcrumb

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

function MultipartStream::__construct

Parameters

array $elements Array of associative arrays, each containing a: required "name" key mapping to the form field, name, a required "contents" key mapping to a StreamInterface/resource/string, an optional "headers" associative array of custom headers, and an optional "filename" key mapping to a string to send as the filename in the part.

string $boundary You can optionally provide a specific boundary:

Throws

\InvalidArgumentException

Overrides StreamDecoratorTrait::__construct

File

vendor/guzzlehttp/psr7/src/MultipartStream.php, line 35

Class

MultipartStream
Stream that when read returns bytes for a streaming multipart or multipart/form-data stream.

Namespace

GuzzleHttp\Psr7

Code

public function __construct(array $elements = [], ?string $boundary = null) {
    $this->boundary = $boundary ?: bin2hex(random_bytes(20));
    $this->stream = $this->createStream($elements);
}

API Navigation

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