Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save s2ar/85a0dd4f648a48c5faaf to your computer and use it in GitHub Desktop.
Save s2ar/85a0dd4f648a48c5faaf to your computer and use it in GitHub Desktop.
Bitrix. Очистить свойство типа Файл.
<?php
$bx_photo = CIBlockElement::GetProperty(
$IBID,
$id,
'sort',
'asc',
array('CODE' => 'PHOTO')
);
$ar_photo = $bx_photo->Fetch();
CIBlockElement::SetPropertyValueCode($_POST['id'], 'PHOTO', array(
$ar_photo['PROPERTY_VALUE_ID'] => array('del' => 'Y', 'tmp_name' => '')
));
CFile::Delete($ar_photo['VALUE']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment