private function SendFile($file_name) { $file_path = GetFilePathInWorkingDir($file_name); if (!file_exists($file_path)) { throw new FsapiException("File not found", 404, $file_name, $this->http_method, $this->url); } http_response_code(200); $fileMetaData = new FileMetaData($file_path); header('Content-Type: ' . $fileMetaData->GetMime()); header("Content-Length:" . $fileMetaData->GetFileSize()); header("Content-Disposition: attachment; filename=" . $fileMetaData->GetFileName()); readfile($file_path); }