Bitrix Site Manager

CFile::Delete

CFile::Delete(
 int id
)

The method Delete removes a file from the file registrar table (b_file) and deletes it from the disk.

Parameters

ParameterDescription
id Numeric ID of the file.

See Also

Example



<?
// delete the form image
$arFilter = array("ID" => 1, "ID_EXACT_MATCH" => "Y");
$rsForm = CForm::GetList($by, $order, $arFilter, $is_filtered);
if ($arForm = $rsForm->Fetch())
{
    if (intval($arForm["IMAGE_ID"])>0) CFile::Delete($arForm["IMAGE_ID"]);	
}
?>