interface InputStreamFileWriterInterface

Same name in other branches
  1. 10 core/modules/file/src/Upload/InputStreamFileWriterInterface.php \Drupal\file\Upload\InputStreamFileWriterInterface

Uploads files from a stream.

Hierarchy

Expanded class hierarchy of InputStreamFileWriterInterface

All classes that implement InputStreamFileWriterInterface

3 files declare their use of InputStreamFileWriterInterface
FileUpload.php in core/modules/jsonapi/src/Controller/FileUpload.php
FileUploadResource.php in core/modules/file/src/Plugin/rest/resource/FileUploadResource.php
TemporaryJsonapiFileFieldUploader.php in core/modules/jsonapi/src/Controller/TemporaryJsonapiFileFieldUploader.php

File

core/modules/file/src/Upload/InputStreamFileWriterInterface.php, line 8

Namespace

Drupal\file\Upload
View source
interface InputStreamFileWriterInterface {
    
    /**
     * The length of bytes to read in each iteration when streaming file data.
     */
    const DEFAULT_BYTES_TO_READ = 8192;
    
    /**
     * The default stream.
     */
    const DEFAULT_STREAM = "php://input";
    
    /**
     * Write the input stream to a temporary file.
     *
     * @param string $stream
     *   (optional) The input stream.
     * @param int $bytesToRead
     *   (optional) The length of bytes to read in each iteration.
     *
     * @return string
     *   The temporary file path.
     */
    public function writeStreamToFile(string $stream = self::DEFAULT_STREAM, int $bytesToRead = self::DEFAULT_BYTES_TO_READ) : string;

}

Members

Title Sort descending Modifiers Object type Summary
InputStreamFileWriterInterface::DEFAULT_BYTES_TO_READ constant The length of bytes to read in each iteration when streaming file data.
InputStreamFileWriterInterface::DEFAULT_STREAM constant The default stream.
InputStreamFileWriterInterface::writeStreamToFile public function Write the input stream to a temporary file.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.