def save(self, location=None, custom_name=None):
if not self.content:<EOL><INDENT>return False<EOL><DEDENT>location = Path(location or '<STR_LIT>')<EOL>if not location.exists():<EOL><INDENT>log.debug('<STR_LIT>')<EOL>return False<EOL><DEDENT>name = custom_name or self.name<EOL>name = name.replace('<STR_LIT:/>', '<STR_LIT:->').replace('<STR_LIT:\\>', '<STR_LIT>')<EOL>try:<EOL><INDENT>path = location / name<EOL>with path.open('<STR_LIT:wb>') as file:<EOL><INDENT>file.write(base64.b64decode(self.content))<EOL><DEDENT>self.attachment = path<EOL>self.on_disk = True<EOL>log.debug('<STR_LIT>')<EOL><DEDENT>except Exception as e:<EOL><INDENT>log.error('<STR_LIT>', str(e))<EOL>return False<EOL><DEDENT>return True<EOL>
Save the attachment locally to disk

        :param str location: path string to where the file is to be saved.
        :param str custom_name: a custom name to be saved as
        :return: Success / Failure
        :rtype: bool