diff --git a/jupyter_drives/manager.py b/jupyter_drives/manager.py index 383020c..9cb3df0 100644 --- a/jupyter_drives/manager.py +++ b/jupyter_drives/manager.py @@ -355,7 +355,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'): + elif options_format == 'base64' and (content_format == 'base64' 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) @@ -371,6 +371,7 @@ async def save_file(self, drive_name, path, content, options_format, content_for formatted_content = content.encode("utf-8") else: formatted_content = content + if formatted_content is None or formatted_content == '': formatted_content = b''