def UploadFile(self, path, file_handle):
    assert self.in_transaction, 'Begin() must be called before UploadFile().'
    if path not in self.files:
      raise KeyError('File \'%s\' is not in the list of files to be uploaded.'
                     % path)

    del self.files[path]
    mime_type = GetMimeTypeIfStaticFile(self.config, path)
    payload = file_handle.read()
    if mime_type is None:
      self.file_batcher.AddToBatch(path, payload, mime_type)
    else:
      self.blob_batcher.AddToBatch(path, payload, mime_type)
Uploads a file to the hosting service.
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/tools/appcfg.py/AppVersionUpload.UploadFile