diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-08 09:33:03 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-08 10:01:50 +0200 |
commit | ea54cd04c1ff0e55651cd5fb1a83672acde68604 (patch) | |
tree | 4e10fea658e72a9f79375d0e9b23d08915d3d0b2 /server/helpers/express-utils.ts | |
parent | 295106516277581ba4967199fa5580264a90ae2c (diff) | |
download | PeerTube-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.ts | 4 |
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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import * as multer from 'multer' | 2 | import * as multer from 'multer' |
3 | import { extname } from 'path' | ||
4 | import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes' | 3 | import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes' |
5 | import { CONFIG } from '../initializers/config' | 4 | import { CONFIG } from '../initializers/config' |
6 | import { REMOTE_SCHEME } from '../initializers/constants' | 5 | import { REMOTE_SCHEME } from '../initializers/constants' |
6 | import { getLowercaseExtension } from './core-utils' | ||
7 | import { isArray } from './custom-validators/misc' | 7 | import { isArray } from './custom-validators/misc' |
8 | import { logger } from './logger' | 8 | import { logger } from './logger' |
9 | import { deleteFileAndCatch, generateRandomString } from './utils' | 9 | import { 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 |