MCPcopy Create free account
hub / github.com/ShipSecAI/studio / downloadFile

Method downloadFile

backend/src/storage/files.controller.ts:114–128  ·  view source on GitHub ↗
(
    @CurrentAuth() auth: AuthContext | null,
    @Param(new ZodValidationPipe(FileIdParamSchema)) params: FileIdParamDto,
    @Res({ passthrough: true }) res: Response,
  )

Source from the content-addressed store, hash-verified

112 },
113 })
114 async downloadFile(
115 @CurrentAuth() auth: AuthContext | null,
116 @Param(new ZodValidationPipe(FileIdParamSchema)) params: FileIdParamDto,
117 @Res({ passthrough: true }) res: Response,
118 ) {
119 const { buffer, file } = await this.filesService.downloadFile(auth, params.id);
120
121 res.set({
122 'Content-Type': file.mimeType,
123 'Content-Disposition': `attachment; filename="${file.fileName}"`,
124 'Content-Length': file.size,
125 });
126
127 return new StreamableFile(buffer);
128 }
129
130 @Delete(':id')
131 @ApiOkResponse({

Callers

nothing calls this directly

Calls 2

downloadFileMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected