You are here

public function BinaryFileResponse::setContentDisposition in Zircon Profile 8

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

Sets the Content-Disposition header with the given filename.

Parameters

string $disposition ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT:

string $filename Optionally use this filename instead of the real name of the file:

string $filenameFallback A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename:

Return value

BinaryFileResponse

1 call to BinaryFileResponse::setContentDisposition()
BinaryFileResponse::setFile in vendor/symfony/http-foundation/BinaryFileResponse.php
Sets the file to stream.

File

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

Class

BinaryFileResponse
BinaryFileResponse represents an HTTP response delivering a file.

Namespace

Symfony\Component\HttpFoundation

Code

public function setContentDisposition($disposition, $filename = '', $filenameFallback = '') {
  if ($filename === '') {
    $filename = $this->file
      ->getFilename();
  }
  $dispositionHeader = $this->headers
    ->makeDisposition($disposition, $filename, $filenameFallback);
  $this->headers
    ->set('Content-Disposition', $dispositionHeader);
  return $this;
}