sindresorhus/file-type

fileTypeFromFile are not defined in browser.d.ts

hrynevychroman opened this issue · 1 comments

Why I can't use this function inside my front-end app to define what mime type is file?

image

Because fileTypeFromFile is used to access files on you local file system, which is only possible via Node.js file sytem API.

If you want to read a File (a File you uploaded in a browser environment), you can use fileTypeFromBlob(blob).

This could be better documented in the README, please keep this issue open until that is clearly captured.