aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/local-actor.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/lib/local-actor.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/lib/local-actor.ts')
-rw-r--r--server/lib/local-actor.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/lib/local-actor.ts b/server/lib/local-actor.ts
index 55e77dd04..2d2bd43a1 100644
--- a/server/lib/local-actor.ts
+++ b/server/lib/local-actor.ts
@@ -1,8 +1,9 @@
1import 'multer' 1import 'multer'
2import { queue } from 'async' 2import { queue } from 'async'
3import * as LRUCache from 'lru-cache' 3import * as LRUCache from 'lru-cache'
4import { extname, join } from 'path' 4import { join } from 'path'
5import { v4 as uuidv4 } from 'uuid' 5import { v4 as uuidv4 } from 'uuid'
6import { getLowercaseExtension } from '@server/helpers/core-utils'
6import { ActorModel } from '@server/models/actor/actor' 7import { ActorModel } from '@server/models/actor/actor'
7import { ActivityPubActorType, ActorImageType } from '@shared/models' 8import { ActivityPubActorType, ActorImageType } from '@shared/models'
8import { retryTransactionWrapper } from '../helpers/database-utils' 9import { retryTransactionWrapper } from '../helpers/database-utils'
@@ -41,7 +42,7 @@ async function updateLocalActorImageFile (
41 ? ACTOR_IMAGES_SIZE.AVATARS 42 ? ACTOR_IMAGES_SIZE.AVATARS
42 : ACTOR_IMAGES_SIZE.BANNERS 43 : ACTOR_IMAGES_SIZE.BANNERS
43 44
44 const extension = extname(imagePhysicalFile.filename) 45 const extension = getLowercaseExtension(imagePhysicalFile.filename)
45 46
46 const imageName = uuidv4() + extension 47 const imageName = uuidv4() + extension
47 const destination = join(CONFIG.STORAGE.ACTOR_IMAGES, imageName) 48 const destination = join(CONFIG.STORAGE.ACTOR_IMAGES, imageName)