protected function processActionExportTemplate() { $this->getApplication()->restartBuffer(); if ($this->arResult['ID'] > 0) { $datum = CBPWorkflowTemplateLoader::exportTemplate($this->arResult['ID']); header("HTTP/1.1 200 OK"); header("Content-Type: application/force-download; name=\"bp-" . $this->arResult['ID'] . ".bpt\""); header("Content-Transfer-Encoding: binary"); header("Content-Length: " . (function_exists('mb_strlen') ? mb_strlen($datum, 'ISO-8859-1') : strlen($datum))); header("Content-Disposition: attachment; filename=\"bp-" . $this->arResult['ID'] . ".bpt\""); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Expires: 0"); header("Pragma: public"); echo $datum; } $this->end(); }