Skip to content

Commit

Permalink
another check
Browse files Browse the repository at this point in the history
  • Loading branch information
gary-singh-filestack committed Jan 4, 2024
1 parent 4d3bd68 commit 494aa2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/lib/api/upload/file_tools.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ export const getFile = (input: InputFile, sanitizeOptions?: SanitizeOptions): Pr
let minimumBytes = 4100;
console.log(!file.type)
if (!file.type || file.type.length === 0 || file.type === 'text/plain') {
console.log("just for fun");
mime = await getMimetype(await res.slice(0, minimumBytes), filename);
}

Expand Down
3 changes: 3 additions & 0 deletions src/lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const uniqueTime = () => {
return last;
};

console.log("just for fun");
/**
* Generates random string with provided length
*
Expand All @@ -102,6 +103,8 @@ export const uniqueId = (len: number = 10): string => {
* @returns {string} - mimetype
*/
export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Promise<string> => {
console.log("just for fun");

let type = await fromBuffer(file);
console.log("reaches here")
const excludedMimetypes = ['text/plain', 'application/octet-stream', 'application/x-ms', 'application/x-msi', 'application/zip'];
Expand Down

0 comments on commit 494aa2e

Please sign in to comment.