diff --git a/backend/src/file/file.controller.ts b/backend/src/file/file.controller.ts index 6e7014fc..dd7b4b95 100644 --- a/backend/src/file/file.controller.ts +++ b/backend/src/file/file.controller.ts @@ -54,13 +54,14 @@ export class FileController { @Res({ passthrough: true }) res: Response, @Param("shareId") shareId: string, ) { - const zip = await this.fileService.getZip(shareId); + const zipStream = this.fileService.getZip(shareId); + res.set({ "Content-Type": "application/zip", "Content-Disposition": contentDisposition(`${shareId}.zip`), }); - return new StreamableFile(zip); + return new StreamableFile(zipStream); } @Get(":fileId") diff --git a/backend/src/file/file.service.ts b/backend/src/file/file.service.ts index e73ed0c7..e5de341f 100644 --- a/backend/src/file/file.service.ts +++ b/backend/src/file/file.service.ts @@ -61,7 +61,7 @@ export class FileService { getZip(shareId: string) { const storageService = this.getStorageService(); - return this.streamToUint8Array(storageService.getZip(shareId) as Readable); + return storageService.getZip(shareId) as Readable; } private async streamToUint8Array(stream: Readable): Promise {