Include extension in S3 key (#1426)

This commit is contained in:
ekzyis 2024-09-24 15:10:43 +02:00 committed by GitHub
parent 18fbd17025
commit b82641d1bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -49,7 +49,10 @@ export default {
}
const upload = await models.upload.create({ data: { ...fileParams } })
return createPresignedPost({ key: String(upload.id), type, size })
const extension = type.split('/')[1]
const key = `${upload.id}.${extension}`
return createPresignedPost({ key, type, size })
}
}
}