public function output($download = false)
{
// Determine if the force download argument has been passed.
$attach = $download ? 'attachment; ' : null;
$headers = array('Content-type' => $this->mime, 'Content-disposition' => $attach . 'filename=' . $this->basename);
$response = new \Pop\Http\Response(200, $headers, $this->read());
if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) {
$response->setSslHeaders();
}
$response->send();
return $this;
}