Closed mytharcher closed 2 years ago
This is not supported by file-type
, and probably won't be: https://github.com/sindresorhus/file-type/issues/55
You can provide a custom function that e.g. falls back to the browser reported file type, but I don't think that we should change the default to that since there is no guarantee that the uploaded file actually is text just because the header said so.
https://github.com/anacronw/multer-s3#setting-custom-content-type
I have a
text/plain
filea.txt
which contains only a string ashello world!
. But thefileType
function only gotnull
result for this file. Not sure if it is a bug fromfile-type@^3.x
(and latest is @17.x).Maybe 2 ways could solve:
mimetype
if exists.file-type
's version to latest and test.