4

we are using Bitrix24 cloud version and created a custom field at CRM Deals.

How can I update this custom field (type:file) using Bitrix API?

Already tried :

$fileContent = file_get_contents(dirname(__FILE__)."/images/MM35_PG189a.jpg");

$batch = array(
  'deal_update' => 'crm.deal.update?'
    .http_build_query(array(
      'id' => 2,
      'fields' => array(
        'UF_CRM_1516125473' => array(
          'filedata' => array(
            'file.jpg',
            base64_encode($fileContent)
          )
        )
      )
    ))
);

$data = call($_SESSION["query_data"]["domain"], "batch", array(
  "auth" => $_SESSION["query_data"]["access_token"],
  "cmd" => $batch,
));
Gustavo
  • 91
  • 1
  • 5

1 Answers1

0

Error in variable name: filedata -> fileData

Ivan
  • 11
  • 5
    It is hard to see the helpfulness of this answer. To improve that, use a little more prose. Also explaining why the very small difference in spelling is relevant would help a lot, including with the helpfulness for future/other readers. – Yunnosch Feb 18 '19 at 20:10