• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/classes/general/iblockelement.php
  • Класс: CAllIBlockElement
  • Вызов: CAllIBlockElement::__GetFileContent
static function __GetFileContent($FILE_ID)
{
	static $max_file_size = null;

	$arFile = CFile::MakeFileArray($FILE_ID);
	if($arFile && $arFile["tmp_name"])
	{
		if(!isset($max_file_size))
			$max_file_size = COption::GetOptionInt("search", "max_file_size", 0)*1024;

		if($max_file_size > 0 && $arFile["size"] > $max_file_size)
			return "";

		$io = CBXVirtualIo::GetInstance();
		$file_abs_path = $io->GetLogicalName($arFile["tmp_name"]);

		$arrFile = false;
		foreach(GetModuleEvents("search", "OnSearchGetFileContent", true) as $arEvent)
		{
			if($arrFile = ExecuteModuleEventEx($arEvent, array($file_abs_path)))
				break;
		}

		return $arrFile;
	}

	return "";
}