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

Breadcrumb

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

function BinaryFileResponse::__construct

Parameters

\SplFileInfo|string $file The file to stream:

int $status The response status code (200 "OK" by default):

array $headers An array of response headers:

bool $public Files are public by default:

string|null $contentDisposition The type of Content-Disposition to set automatically with the filename:

bool $autoEtag Whether the ETag header should be automatically set:

bool $autoLastModified Whether the Last-Modified header should be automatically set:

Overrides Response::__construct

File

vendor/symfony/http-foundation/BinaryFileResponse.php, line 46

Class

BinaryFileResponse
BinaryFileResponse represents an HTTP response delivering a file.

Namespace

Symfony\Component\HttpFoundation

Code

public function __construct(\SplFileInfo|string $file, int $status = 200, array $headers = [], bool $public = true, ?string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) {
    parent::__construct(null, $status, $headers);
    $this->setFile($file, $contentDisposition, $autoEtag, $autoLastModified);
    if ($public) {
        $this->setPublic();
    }
}

API Navigation

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