public function BinaryFileResponse::__construct

Constructor.

Parameters

SplFileInfo|string $file The file to stream:

integer $status The response status code:

array $headers An array of response headers:

boolean $public Files are public by default:

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

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

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

Overrides Response::__construct

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/BinaryFileResponse.php, line 45

Class

BinaryFileResponse
BinaryFileResponse represents an HTTP response delivering a file.

Namespace

Symfony\Component\HttpFoundation

Code

public function __construct($file, $status = 200, $headers = array(), $public = true, $contentDisposition = null, $autoEtag = false, $autoLastModified = true) {
  parent::__construct(null, $status, $headers);
  $this
    ->setFile($file, $contentDisposition, $autoEtag, $autoLastModified);
  if ($public) {
    $this
      ->setPublic();
  }
}