• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/controller/export.php
  • Класс: BitrixMainControllerExport
  • Вызов: Export::downloadAction
public function downloadAction()
{
	if (
		$this->filePath !== '' &&
		$this->fileName !== ''
	)
	{
		$path = new MainIOFile($this->filePath);
		if ($path->isExists())
		{

			$response = new MainEngineResponseFile(
				$path->getPath(),
				$this->fileName,
				$this->getFileType()
			);

			return $response;
		}
	}

	$this->addError(new Error('File not found'));
}