Skip to content

Commit af3863d

Browse files
handle other types
1 parent 57413c8 commit af3863d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/utils/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Prom
106106
try {
107107
type = await fromBuffer(file);
108108
} catch(e) {
109-
return 'application/octet-stream'
109+
const mime = extensionToMime(name);
110+
if (mime) {
111+
return mime;
112+
}
110113
}
111114
const excludedMimetypes = ['text/plain', 'application/octet-stream', 'application/x-ms', 'application/x-msi', 'application/zip'];
112115

0 commit comments

Comments
 (0)