<?php
namespace Engine\Mvc\Response; class BigFileDownload extends GeneralAbstract { public $body = null; protected $filename = null; protected $filesize = null; public $compressionMethod = null; protected function initialize($filePath, array $headersArr) { $this->body = new Components\File($filePath); $this->headers = new Components\Headers($headersArr); $this->generateDownloadHeaders(); if ($this->body->hasContent()) { $this->setFilesize($this->body->get()->getSize()); } } public function setFilename($filename) { $this->filename = $filename; $this->headers->append('Content-Disposition', sprintf('attachment; filename="%s";', $this->filename)); } private function setFilesize($filesize) { $this->filesize = $filesize; $this->headers->append('Content-Length', $this->filesize); } protected function generateDownloadHeaders() { } } 