$data = file_get_contents($url);
$base64 = base64_encode($data);
$fileName = urldecode(basename($url));
$fileData = [$fileName, $base64];
$arParams['UF_CRM_1566289984628'] = ['fileData' => $fileData ];
$target = md5('salt'.$_FILES['spec_file']['name']);
$path = 'sales/upload/'.$target;
move_uploaded_file($_FILES['spec_file']['tmp_name'], $path);
$UF_CRM_1552985294 = array('fileData'=>array($_FILES['spec_file']['name'], base64_encode(file_get_contents($path))));
$CB24 = new CB24;
$cur_deal = $CB24->method('crm.deal.update.json',array(
"id" => $dealid,
"fields" => [
'UF_CRM_1552985294' => $UF_CRM_1552985294,
],
)
);
$sendData = [
"id" => $deal_id,
"fields" => [
"UF_CRM_1552985294" => [
[
"fileData" => [
$_FILES["file"]["name"],
base64_encode(file_get_contents($_FILES["file"]["tmp_name"]))
]
],
[
"fileData" => [
$_FILES["file_2"]["name"],
base64_encode(file_get_contents($_FILES["file_2"]["tmp_name"]))
]
],
]
]
];