title: Bitrix24 API : How to update a CRM Deal file custom field
body: <p>we are using Bitrix24 cloud version and created a custom field at CRM Deals.</p>
  
  <p>How can I update this custom field (type:file) using Bitrix API?</p>
  
  <p>Already tried :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>$fileContent = file_get_contents(dirname(__FILE__)."/images/MM35_PG189a.jpg");
  
  $batch = array(
    'deal_update' =&gt; 'crm.deal.update?'
      .http_build_query(array(
        'id' =&gt; 2,
        'fields' =&gt; array(
          'UF_CRM_1516125473' =&gt; array(
            'filedata' =&gt; array(
              'file.jpg',
              base64_encode($fileContent)
            )
          )
        )
      ))
  );
  
  $data = call($_SESSION["query_data"]["domain"], "batch", array(
    "auth" =&gt; $_SESSION["query_data"]["access_token"],
    "cmd" =&gt; $batch,
  ));</code></pre>
  </div>
  </div>
  </p>