Skip to content

Commit

Permalink
handle other types
Browse files Browse the repository at this point in the history
  • Loading branch information
gary-singh-filestack committed Jan 5, 2024
1 parent 57413c8 commit af3863d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Prom
try {
type = await fromBuffer(file);
} catch(e) {
return 'application/octet-stream'
const mime = extensionToMime(name);
if (mime) {
return mime;
}
}
const excludedMimetypes = ['text/plain', 'application/octet-stream', 'application/x-ms', 'application/x-msi', 'application/zip'];

Expand Down

0 comments on commit af3863d

Please sign in to comment.