title: Google_Service_Exception: fieldNotWritable when uploading a new version of the file on Google Drive
body: <p>My intention is to be able to upload a new version of the file which is already available on Google Drive.</p>
  
  <p>I've started by the PHP example at <a href="https://developers.google.com/drive/v2/reference/files/update#examples" rel="nofollow noreferrer">https://developers.google.com/drive/v2/reference/files/update#examples</a> .</p>
  
  <pre><code>function updateFile($fileID, $uploadFile) {
      try {
          $file = $this-&gt;service-&gt;files-&gt;get($fileID);
  
          $content = file_get_contents($uploadFile);
          $file = $this-&gt;service-&gt;files-&gt;update($fileID, $file, array(
              'data' =&gt; $content,
          ));
          printf("Updated File ID: %s\n", $file-&gt;getId());
      } catch (Exception $e) {
          echo get_class($e), ': ', $e-&gt;getMessage(), PHP_EOL;
      }
  }
  </code></pre>
  
  <p>As a result I get </p>
  
  <pre><code>Google_Service_Exception: {
   "error": {
    "errors": [
     {
      "domain": "global",
      "reason": "fieldNotWritable",
      "message": "The resource body includes fields which are not directly writable."
     }
    ],
    "code": 403,
    "message": "The resource body includes fields which are not directly writable."
   }
  }
  </code></pre>
  
  <p>I don't get what are the not-writable fields in question. The only thing I'm changing is the actual content of the file, none of it's metadata.</p>
  
  <p>Any ideas what's wrong?</p>