From ea54cd04c1ff0e55651cd5fb1a83672acde68604 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 8 Jun 2021 09:33:03 +0200 Subject: Fix video upload with a capitalized ext --- server/helpers/express-utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/helpers/express-utils.ts') diff --git a/server/helpers/express-utils.ts b/server/helpers/express-utils.ts index 010c6961a..003e02818 100644 --- a/server/helpers/express-utils.ts +++ b/server/helpers/express-utils.ts @@ -1,9 +1,9 @@ import * as express from 'express' import * as multer from 'multer' -import { extname } from 'path' import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes' import { CONFIG } from '../initializers/config' import { REMOTE_SCHEME } from '../initializers/constants' +import { getLowercaseExtension } from './core-utils' import { isArray } from './custom-validators/misc' import { logger } from './logger' import { deleteFileAndCatch, generateRandomString } from './utils' @@ -79,7 +79,7 @@ function createReqFiles ( filename: async (req, file, cb) => { let extension: string - const fileExtension = extname(file.originalname) + const fileExtension = getLowercaseExtension(file.originalname) const extensionFromMimetype = getExtFromMimetype(mimeTypes, file.mimetype) // Take the file extension if we don't understand the mime type -- cgit v1.2.3