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\HttpFoundationCode
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();
}
}