title: Google Drive API v3 updating a file on the go (using realtime data) in python
body: <p>I am trying to update a file that I created with some new data. Essentially, i am trying to append contents to an already created file. I have tried different ways using different attributes but nothing seems to work so far. The migration from v2 to v3 seems to have made things harder to develop in python.</p>
  
  <p>This is my code so far</p>
  
  <pre><code>def updateFile(fileID, contents):
      credentials = get_credentials() #this function gets the credentials for oauth
      http = credentials.authorize(httplib2.Http())
      service = discovery.build('drive', 'v3', http=http)
      # First retrieve the file from the API.
  
      #fileCreated = service.files().get(fileId=fileID).execute()
      #print(dir(fileCreated.update()))
      # File's new content.
      file_metadata = { 'name' : 'notes.txt', 'description' : 'this is a test' }
      fh  = BytesIO(contents.encode())
      media = MediaIoBaseUpload(fh,
                          mimetype='text/plain')
      # Send the request to the API.
      #print(BytesIO(contents.encode()).read())
      print(fileID)
      updated_file = service.files().update(
          body=file_metadata,
          #uploadType = 'media',
          fileId=fileID,
          #fields = fileID,
          media_body=media).execute()
  </code></pre>
  
  <p>I have tried using MediaFileUpload (it works only for uploading a file) but I am appending a 'string' that is real time generated using a voice interface and is not stored in any file. So I ended up using MediaIoBaseUpload. </p>
  
  <p>The code runs without any error, but the file is not updated. Any help is appreciated.</p>