aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/express-utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-08 09:33:03 +0200
committerChocobozzz <me@florianbigard.com>2021-06-08 10:01:50 +0200
commitea54cd04c1ff0e55651cd5fb1a83672acde68604 (patch)
tree4e10fea658e72a9f79375d0e9b23d08915d3d0b2 /server/helpers/express-utils.ts
parent295106516277581ba4967199fa5580264a90ae2c (diff)
downloadPeerTube-ea54cd04c1ff0e55651cd5fb1a83672acde68604.tar.gz
PeerTube-ea54cd04c1ff0e55651cd5fb1a83672acde68604.tar.zst
PeerTube-ea54cd04c1ff0e55651cd5fb1a83672acde68604.zip
Fix video upload with a capitalized ext
Diffstat (limited to 'server/helpers/express-utils.ts')
-rw-r--r--server/helpers/express-utils.ts4
1 files changed, 2 insertions, 2 deletions
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 @@
1import * as express from 'express' 1import * as express from 'express'
2import * as multer from 'multer' 2import * as multer from 'multer'
3import { extname } from 'path'
4import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes' 3import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes'
5import { CONFIG } from '../initializers/config' 4import { CONFIG } from '../initializers/config'
6import { REMOTE_SCHEME } from '../initializers/constants' 5import { REMOTE_SCHEME } from '../initializers/constants'
6import { getLowercaseExtension } from './core-utils'
7import { isArray } from './custom-validators/misc' 7import { isArray } from './custom-validators/misc'
8import { logger } from './logger' 8import { logger } from './logger'
9import { deleteFileAndCatch, generateRandomString } from './utils' 9import { deleteFileAndCatch, generateRandomString } from './utils'
@@ -79,7 +79,7 @@ function createReqFiles (
79 79
80 filename: async (req, file, cb) => { 80 filename: async (req, file, cb) => {
81 let extension: string 81 let extension: string
82 const fileExtension = extname(file.originalname) 82 const fileExtension = getLowercaseExtension(file.originalname)
83 const extensionFromMimetype = getExtFromMimetype(mimeTypes, file.mimetype) 83 const extensionFromMimetype = getExtFromMimetype(mimeTypes, file.mimetype)
84 84
85 // Take the file extension if we don't understand the mime type 85 // Take the file extension if we don't understand the mime type