diff --git a/upload-api/src/routes/index.ts b/upload-api/src/routes/index.ts index d6157c24d..16e187161 100644 --- a/upload-api/src/routes/index.ts +++ b/upload-api/src/routes/index.ts @@ -373,7 +373,8 @@ router.get( return res.send('Filename could not be determined from the local path.'); } - const name = fileName?.split?.('.')?.[0]; + + const name = sanitizeFilename(fileName?.split?.('.')?.[0] ?? ''); const fileExt = fileName?.split('.')?.pop() ?? ''; const bodyStream = createReadStream(localPath);