D
D
Darklt2020-02-12 14:23:42
1C-Bitrix
Darklt, 2020-02-12 14:23:42

Why does the custom file type field in Bitrix not want to add a pdf file?

You need to upload a PDF in the custom field of the section.
Added a custom field of type File.

Inserted in result_modifer

$db_list = CIBlockSection::GetList(Array($by=>$order), $arFilter = Array("IBLOCK_ID"=>$arParams["IBLOCK_ID"], "ID"=>$arResult['SECTIONS']), true,$arSelect=Array("UF_FILES"));
while($ar_result = $db_list->GetNext()) {
   $arResult["UF_FILES"][$ar_result["ID"]] = CFile::GetPath($ar_result["UF_FILES"]);
}


And in the template

<?if($arResult['UF_FILES'][$arResult['ID']]):{?>

<a target="_blank" href="<? echo $arResult['UF_FILES'][$arResult['ID']];?>">Посмотреть</a>
<
<?}endif;?>


But in the admin panel, when adding a pdf, it does not load it and everything is simply reset.

Pictures load quietly.

In the settings of all infoblocks of the visual everywhere, I also added the pdf format.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Darklt, 2020-02-12
@Darklt

The issue was resolved, it was in PHP upload_max_filesize 2M , set more.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question