Use path.extname if mime-type doesnt find extension

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
Alexandre Bodin 2020-04-16 10:50:18 +02:00
parent 89af73ca14
commit b44a57d408

View File

@ -33,7 +33,7 @@ const combineFilters = params => {
module.exports = {
formatFileInfo({ filename, type, size }, fileInfo = {}, metas = {}) {
const ext = '.' + mime.extension(type);
const ext = '.' + mime.extension(type) || path.extname(filename);
const baseName = path.basename(filename, path.extname(filename));
const usedName = fileInfo.name || baseName;