You are here

public function BinaryFileResponse::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/BinaryFileResponse.php \Symfony\Component\HttpFoundation\BinaryFileResponse::__construct()

Constructor.

Parameters

\SplFileInfo|string $file The file to stream:

int $status The response status code:

array $headers An array of response headers:

bool $public Files are public by default:

null|string $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($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();
  }
}