Skip to content

Commit cf59e24

Browse files
authored
Merge pull request #62 from DenisaCG/fix
Fix notebook uploading
2 parents 7dd020c + 2974ed8 commit cf59e24

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jupyter_drives/manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ async def save_file(self, drive_name, path, content, options_format, content_for
355355
if options_format == 'json':
356356
formatted_content = json.dumps(content, indent=2)
357357
formatted_content = formatted_content.encode("utf-8")
358-
elif options_format == 'base64' and (content_format == 'base64' or content_type == 'PDF'):
358+
elif options_format == 'base64' and (content_format == 'base64' or content_type == 'PDF' or content_type == 'notebook'):
359359
# transform base64 encoding to a UTF-8 byte array for saving or storing
360360
byte_characters = base64.b64decode(content)
361361

@@ -371,6 +371,7 @@ async def save_file(self, drive_name, path, content, options_format, content_for
371371
formatted_content = content.encode("utf-8")
372372
else:
373373
formatted_content = content
374+
374375
if formatted_content is None or formatted_content == '':
375376
formatted_content = b''
376377

0 commit comments

Comments
 (0)