if (is_uploaded_file($_FILES["file"]["tmp_name"])) {
$arFileArray = array(
"name" => $_FILES["file"]["name"],
"size" => $_FILES["file"]["size"],
"tmp_name" => $_FILES["file"]["tmp_name"],
"type" => $_FILES["file"]["type"],
"MODULE_ID" => "highloadblock"
);
$FileID = CFile::SaveFile($arFileArray, "highloadblock");
}
$hlblock_id = 1;
$hlblock = HL\HighloadBlockTable::getById($hlblock_id)->Fetch();
$entity = HL\HighloadBlockTable::compileEntity($hlblock);
$entity_data_class = $entity->getDataClass();
$result = $entity_data_class::add(
"UF_UPLOAD_FILE" => $FileID
);