aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/uploadx.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/uploadx.ts')
-rw-r--r--server/lib/uploadx.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/lib/uploadx.ts b/server/lib/uploadx.ts
index 58040cb6d..c7e0eb414 100644
--- a/server/lib/uploadx.ts
+++ b/server/lib/uploadx.ts
@@ -3,6 +3,7 @@ import { buildLogger } from '@server/helpers/logger'
3import { getResumableUploadPath } from '@server/helpers/upload' 3import { getResumableUploadPath } from '@server/helpers/upload'
4import { CONFIG } from '@server/initializers/config' 4import { CONFIG } from '@server/initializers/config'
5import { LogLevel, Uploadx } from '@uploadx/core' 5import { LogLevel, Uploadx } from '@uploadx/core'
6import { extname } from 'path'
6 7
7const logger = buildLogger('uploadx') 8const logger = buildLogger('uploadx')
8 9
@@ -26,7 +27,9 @@ const uploadx = new Uploadx({
26 if (!res.locals.oauth) return undefined 27 if (!res.locals.oauth) return undefined
27 28
28 return res.locals.oauth.token.user.id + '' 29 return res.locals.oauth.token.user.id + ''
29 } 30 },
31
32 filename: file => `${file.userId}-${file.id}${extname(file.metadata.filename)}`
30}) 33})
31 34
32export { 35export {