Skip to content

Commit 7dedaa1

Browse files
committed
fix text file upload functionality
1 parent a464951 commit 7dedaa1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jupyter_drives/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ async def save_file(self, drive_name, path, content, options_format, content_for
487487
if options_format == 'json':
488488
formatted_content = json.dumps(content, indent=2)
489489
formatted_content = formatted_content.encode("utf-8")
490-
elif options_format == 'base64' and (content_format == 'base64' or content_type == 'PDF' or content_type == 'notebook'):
490+
elif options_format == 'base64' and (content_format == 'base64' or (content_format == 'text' and content_type != 'PDF') or content_type == 'PDF' or content_type == 'notebook'):
491491
# transform base64 encoding to a UTF-8 byte array for saving or storing
492492
byte_characters = base64.b64decode(content)
493493

0 commit comments

Comments
 (0)