public function download($file, $filename = null, array $headers = [], $disposition = 'attachment')
    {
        $type = mime_content_type($file);

        if ($filename == null) {
            $filename = basename($file);
        }

        $this->addHeader('Content-Disposition', $disposition.'; filename='.$filename);

        $this->addHeader('Content-Type', $type);

        $this->addHeader('Content-Length', filesize($file));

        $this->addHeader('Content-Encoding', 'base64');

        foreach ($headers as $key => $value) {
            $this->addHeader($key, $value);
        }

        $this->download_filename = $file;

        $this->download = true;

        return $this->buildHttpResponse();
    }