public function BinaryFileResponse::sendContent

Sends the file.

Overrides Response::sendContent

File

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

Class

BinaryFileResponse
BinaryFileResponse represents an HTTP response delivering a file.

Namespace

Symfony\Component\HttpFoundation

Code

public function sendContent() {
  if (!$this
    ->isSuccessful()) {
    parent::sendContent();
    return;
  }
  if (0 === $this->maxlen) {
    return;
  }
  $out = fopen('php://output', 'wb');
  $file = fopen($this->file
    ->getPathname(), 'rb');
  stream_copy_to_stream($file, $out, $this->maxlen, $this->offset);
  fclose($out);
  fclose($file);
}