diff --git a/server/commands/collectionExporter.ts b/server/commands/collectionExporter.ts index c188404ba..e709575c7 100644 --- a/server/commands/collectionExporter.ts +++ b/server/commands/collectionExporter.ts @@ -19,8 +19,14 @@ type Props = { transaction: Transaction; }; -function getKeyForFileOp(teamId: string, name: string) { - return `${Buckets.uploads}/${teamId}/${uuidv4()}/${name}-export.zip`; +function getKeyForFileOp( + teamId: string, + format: FileOperationFormat, + name: string +) { + return `${ + Buckets.uploads + }/${teamId}/${uuidv4()}/${name}-export.${format.replace(/outline-/, "")}.zip`; } async function collectionExporter({ @@ -33,7 +39,11 @@ async function collectionExporter({ transaction, }: Props) { const collectionId = collection?.id; - const key = getKeyForFileOp(user.teamId, collection?.name || team.name); + const key = getKeyForFileOp( + user.teamId, + format, + collection?.name || team.name + ); const fileOperation = await FileOperation.create( { type: FileOperationType.Export,