Documentation

GetByID

CDBResult
CFile::GetByID(
 int file_id
)

The method returns information on a registered file as an instance of the CDBResult class. Static method.

Parameters

ParameterDescription
file_id File numerical ID.

See Also

Examples of use

<?
if ($rsElements = GetIBlockElementListEx($IBLOCK_TYPE, $IBLOCK_ID, false, array($ELEMENT_SORT_FIELD => $ELEMENT_SORT_ORDER, "ID" => "ASC"), false, $arrFilter)):
    $rsElements->NavStart($PAGE_ELEMENT_COUNT);
	while ($obElement = $rsElements->GetNextElement()):
		$arElement = $obElement->GetFields();
		$rsFile = CFile::GetByID($arElement["PREVIEW_PICTURE"]);
		$arFile = $rsFile->Fetch();
		$arrImages[$arElement["ID"]][] = $arFile;
	endwhile;
endif;
?>


© «Bitrix24», 2001-2024