title: How to send documents for Telegram API with multipart/form-data?
body: <p>I want to sent documents and photos with the Telegram API. Problem is, that once it's sent, it's cached in on there servers. But if my document changes, I send old versions. For the documentation says:</p>
  
  <blockquote>
    <p>Pass a file_id as String to send a file that exists on the Telegram
    servers (recommended), pass an HTTP URL as a String for Telegram to
    get a file from the Internet, or upload a new one using
    multipart/form-data</p>
  </blockquote>
  
  <p>But I'm not sure how to implement this. I tried with the following, sending HTTPHEADER, but it's still sending the cached version :/</p>
  
  <pre><code>function sendPhoto($bot_id,$chat_id,$caption,$disable_notification,$photo_url)
  {
      $ch = curl_init('https://api.telegram.org/bot'.$bot_id.'/sendPhoto');
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  
      $param = array(
          'chat_id' =&gt; $chat_id,
          'caption' =&gt; $caption,
          'parse_mode' =&gt; 'html',
          'disable_notification' =&gt; $disable_notification,
          'photo' =&gt; $photo_url
      );
  
      curl_setopt($ch, CURLOPT_POST, 1);
      curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($param));
  
      $result = curl_exec($ch);
      curl_close($ch);
  
      return $result;
  }
  </code></pre>
  
  <p>Can someone help me please ? :) </p>