title: Uploading Textfiles to GCP-Storage with php changes the content of the file
body: <p>I would like to upload a textfile to Google Cloud Storage.
  I use this function in php:</p>
  <pre><code>    function upload_object_to_Google_bucket($bucket,$accesstoken,$proxy,$objectname,$objectpath)
  {
  #Build the CUrl: incarnate.github.io/curl-to-php
      $ch=curl_init();
      curl_setopt($ch, CURLOPT_URL, &quot;https://storage.googleapis.com/upload/storage/v1/b/&quot;.$bucket.&quot;/o?uploadType=media&amp;name=&quot;.$objectname);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
  #    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, &quot;PUT&quot;);
      curl_setopt($ch, CURLOPT_POST, 1);
      curl_setopt($ch, CURLOPT_HEADER, false);
      $file=$objectpath.$objectname;
      $item=make_curl_file($file);
      print_r($item);
      $file = $objectpath.$objectname;
      $post = array(
      $item
      );
  #    curl_setopt($ch, CURLOPT_UPLOAD, true);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  #    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
      curl_setopt($ch, CURLOPT_PROXY, $proxy);
      curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  #    curl_setopt($ch, CURLOPT_NOBODY, true);
      $headers = array();
      $headers[] = 'Authorization: Bearer '.$accesstoken;
      $headers[] = 'Content-Type: '.object_to_array($item)[&quot;mime&quot;];
      $headers[] = 'Content-Length: '.filesize($file);
      curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
      $response = curl_exec($ch);
      print_r($response);
      if (curl_errno($ch)){
      echo 'Error:' . curl_error($ch);
      }
      curl_close($ch);
  }
  </code></pre>
  <p>It's all fine, but the textfile has become new content in the Bucket.</p>
  <pre><code>    --------------------------9ad622dfd933f230
  Content-Disposition: form-data; name=&quot;0&quot;; filename=&quot;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xml&quot;
  Content-Type: text/plain
  </code></pre>
  <p>These lines are added to the file. Does anyone has an idea whats the problem and how I can avoid this behaviour?</p>