def save_file(fs, file_id, path):
  """
  Copy a file from MongoDB GridFS to a local file system path
  """
  file_data = fs.get(file_id)
  tempf = open(path, 'wb')
  tempf.write(file_data.read())
  tempf.close()
  return path