Change minimumBytes in file-type

This commit is contained in:
Pavel Djundik 2020-02-06 12:41:43 +02:00
parent 4d5f15b32e
commit 87c9abe9da

View File

@ -234,7 +234,7 @@ class Uploader {
// Returns a string with the type otherwise // Returns a string with the type otherwise
static async getFileType(filePath) { static async getFileType(filePath) {
try { try {
const buffer = readChunk.sync(filePath, 0, fileType.minimumBytes); const buffer = await readChunk(filePath, 0, 5120);
// returns {ext, mime} if found, null if not. // returns {ext, mime} if found, null if not.
const file = await fileType.fromBuffer(buffer); const file = await fileType.fromBuffer(buffer);