diff --git a/jupyter_drives/manager.py b/jupyter_drives/manager.py index 3d7a7c0..1524564 100644 --- a/jupyter_drives/manager.py +++ b/jupyter_drives/manager.py @@ -487,7 +487,7 @@ async def save_file(self, drive_name, path, content, options_format, content_for if options_format == 'json': formatted_content = json.dumps(content, indent=2) formatted_content = formatted_content.encode("utf-8") - elif options_format == 'base64' and (content_format == 'base64' or content_type == 'PDF' or content_type == 'notebook'): + elif options_format == 'base64' and (content_format == 'base64' or (content_format == 'text' and content_type != 'PDF') or content_type == 'PDF' or content_type == 'notebook'): # transform base64 encoding to a UTF-8 byte array for saving or storing byte_characters = base64.b64decode(content)