• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/controller/export.php
  • Класс: BitrixMainControllerExport
  • Вызов: Export::generateExportFileName
protected function generateExportFileName()
{
	if ($this->exportType === self::EXPORT_TYPE_CSV)
	{
		$fileExt = 'csv';
	}
	elseif ($this->exportType === self::EXPORT_TYPE_EXCEL)
	{
		$fileExt = 'xls';
	}

	$prefix = date('Ymd');
	$hash = str_pad(dechex(crc32($prefix)), 8, '0', STR_PAD_LEFT);

	return uniqid($prefix. '_'. $hash. '_', false).'.'.$fileExt;
}