Answer the question
In order to leave comments, you need to log in
How to update multiple file type field when?
I update the elements with the code using CIBlockElement::Update
The multiple property of the file type adds more photos, but it is necessary that the previous ones be deleted and new ones added. What needs to be done for this? (no need to delete the file)
Answer the question
In order to leave comments, you need to log in
Something like this:
$rsProp = CIBlockElement::GetProperty($IBLOCK_ID, $ELEMENT_ID, array('sort' => 'asc'), array('CODE' => 'FILES'));
while($arProp = $rsProp->Fetch())
$PROPERTY_VALUE[$arProp['PROPERTY_VALUE_ID']] = array('VALUE' => array('del'=>'Y'));
$PROPERTY_VALUE[] = CFile::MakeFileArray($_SERVER["DOCUMENT_ROOT"]."/new_image.jpg");
CIBlockElement::SetPropertyValues($ELEMENT_ID, $IBLOCK_ID, $PROPERTY_VALUE, 'FILES');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question