E
E
Eugene M2020-11-22 13:53:42
1C-Bitrix
Eugene M, 2020-11-22 13:53:42

How to display the size and description of the file in catalog.element in BUS?

So only the link is displayed, you also need the size and description of what is indicated in the admin panel of the file!

<?foreach($arResult["PROPERTIES"]["FILES"]["VALUE"] as $val):?>                               
<? $src = CFile::GetPath($val); ?>
<div>
<a class="arrow" href="<?=$src;?>" target="_blank"><strong><u>Скачать файл</u></strong> (PDF, 68 KB)</a>
</div>	
<?endforeach;?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
smilingcheater, 2020-11-22
@smilingcheater

Read the docks
https://dev.1c-bitrix.ru/api_help/main/reference/c...
$fileData = (new \CFile())->GetByID($val)->Fetch();
and see what's in the resulting array
In general, it's better to use https://dev.1c-bitrix.ru/api_help/main/reference/c... in order not to make requests in a loop

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question