Skip to content

Commit 994e420

Browse files
committed
update logic to work with multiple file formats
1 parent 45aefbf commit 994e420

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/plugins/driveBrowserPlugin.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,11 @@ namespace Private {
756756
const toDir = factory.tracker.currentWidget!.model.path;
757757
app.serviceManager.contents.save(PathExt.join(toDir, fileName), {
758758
type: 'file',
759-
format: 'text',
759+
format:
760+
PathExt.extname(fileName) === '.txt' ||
761+
PathExt.extname(fileName) === '.ipynb'
762+
? 'text'
763+
: 'base64',
760764
content: (
761765
await getContents(driveName, {
762766
path: currentPath,

0 commit comments

Comments
 (0)