Documentation

GetPath

string
CFile::GetPath(
 int file_id
)

The method returns path from site root to the registered file. Returns NULL, if the file is not registered. Static method.

Parameters

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

Get path to image

CFile::GetPath($arItem["PICTURE"]);


© «Bitrix24», 2001-2024