Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/drive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,16 @@ export class FileSystemDrive implements Contents.IDrive {
let format: Contents.FileFormat;
let fileContent: any = null;

// We assume here image, audio and video mimetypes are all and only binary files we'll encounter
// We assume here image, audio, video, zip and pdf mimetypes are all and only binary files we'll encounter
if (
file.type &&
file.type.split('/') &&
['image', 'audio', 'video'].includes(file.type.split('/')[0])
((file.type.split('/') &&
['image', 'audio', 'video'].includes(file.type.split('/')[0])) ||
[
'application/zip',
'application/pdf',
'application/octet-stream'
].includes(file.type))
) {
format = 'base64';
} else {
Expand Down