diff --git a/src/lib/api/upload/file_tools.browser.ts b/src/lib/api/upload/file_tools.browser.ts index 21653a72..7a512e4c 100644 --- a/src/lib/api/upload/file_tools.browser.ts +++ b/src/lib/api/upload/file_tools.browser.ts @@ -179,7 +179,6 @@ export const getFile = (input: InputFile, sanitizeOptions?: SanitizeOptions): Pr async res => { let mime = file.type; let minimumBytes = 4100; - console.log("just for fun") if (!file.type || file.type.length === 0 || file.type === 'text/plain') { mime = await getMimetype(await res.slice(0, minimumBytes), filename); } diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index a5154bf9..2f820b2e 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -106,10 +106,11 @@ export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Prom try { type = await fromBuffer(file); } catch(e) { - const mime = extensionToMime(name); - if (mime) { - return mime; - } + // const mime = extensionToMime(name); + // if (mime) { + // return mime; + // } + console.log("catching") } const excludedMimetypes = ['text/plain', 'application/octet-stream', 'application/x-ms', 'application/x-msi', 'application/zip'];