Answer the question
In order to leave comments, you need to log in
How to update the File multiple property of an element in Bitrix?
$el = new CIBlockElement;
$arLoadProductArray = Array(
"PROPERTY_VALUES"=> array(
"PHOTOS" => array(
($_FILES["PHOTO_1"]["size"] == 0) ? CFile::MakeFileArray($arCard["PROPS"]["PHOTOS"]["VALUE"][0]) : $_FILES["PHOTO_1"],
($_FILES["PHOTO_2"]["size"] == 0) ? CFile::MakeFileArray($arCard["PROPS"]["PHOTOS"]["VALUE"][1]) : $_FILES["PHOTO_2"]
)
)
);
$res = $el->Update($arCard["FIELDS"]["ID"], $arLoadProductArray);
Answer the question
In order to leave comments, you need to log in
Firstly, see how to work with a multiple property of the "File" type here: https://dev.1c-bitrix.ru/learning/course/index.php...
Secondly, I will add from myself that not specified in the documentation: to add a new file without deleting the old ones, use the CIBlockElement::SetPropertyValueCode method, not CIBlockElement::SetPropertyValuesEx
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question