Bitrix Site Manager

CFile::GetPath

string
CFile::GetPath(
 int file_id
)

The method GetPath returns the root path of a registered file.

Parameters

ParameterDescription
file_id File ID.

See Also

Example



<?
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();
    $arImagesPath[$arElement["PREVIEW_PICTURE"]] = 
        CFile::GetPath($arElement["PREVIEW_PICTURE"]);
  endwhile;
endif;
?>