def _save_attachment(storage, attachment, filepath):
    """Saves an attachment and returns the filename."""
    filepath = storage.save(filepath, attachment)
    # In case of duplicate filename, storage suffixes filename.
    return filepath.split('/')[-1]