mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Fix video upload with a capitalized ext
This commit is contained in:
parent
2951065162
commit
ea54cd04c1
10 changed files with 82 additions and 49 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue