function handleResult(WebResponse $response) { if ($this->contentType) { $response->addHeader('Content-Type', $this->contentType); } $fileSize = filesize($this->filepath); $creation = date(DateTime::RFC822, filectime($this->filepath)); $modif = date(DateTime::RFC822, filemtime($this->filepath)); $response->addHeader('Content-Disposition', "attachment; filename=\"{$this->filename}\"; size={$fileSize}; creation-date={$creation}; modification-date={$modif}"); $response->writeFile($this->filepath)->finish(); }