title: Upload File in chunks to URL Endpoint using Guzzle PHP
body: <p>I want to upload files in chunks to a URL endpoint using guzzle.</p>
  
  <p>I should be able to provide the Content-Range and Content-Length headers.</p>
  
  <p>Using php I know I can split using</p>
  
  <pre><code>define('CHUNK_SIZE', 1024*1024); // Size (in bytes) of chunk
  
  function readfile_chunked($filename, $retbytes = TRUE) {
      $buffer = '';
      $cnt    = 0;
      $handle = fopen($filename, 'rb');
  
      if ($handle === false) {
          return false;
      }
  
      while (!feof($handle)) {
          $buffer = fread($handle, CHUNK_SIZE);
          echo $buffer;
          ob_flush();
          flush();
  
          if ($retbytes) {
              $cnt += strlen($buffer);
          }
      }
  
      $status = fclose($handle);
  
      if ($retbytes &amp;&amp; $status) {
          return $cnt; // return num. bytes delivered like readfile() does.
      }
  
      return $status;
  }
  </code></pre>
  
  <p>How Do I achieve sending the files in chunk using guzzle, if possible using guzzle streams?</p>