def METHOD_NAME(self, content, key):
    path = self.get_path(key)
    dirpath = dirname(path)
    if not isdir(dirpath):
        os.makedirs(dirpath)
    with open(path, "wb") as fh:
        while True:
            chunk = content.read(CHUNK_SIZE)
            if not chunk:
                break
            fh.write(chunk)