Report File Streamer
Component Detail
Infrastructure
low complexity
backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
Infrastructure utility that handles server-side file generation and HTTP streaming for the Bufdir export artifact. Sets appropriate Content-Disposition and Content-Type headers, buffers the generated payload, and streams it directly to the client without persisting to disk.
report-file-streamer
Responsibilities
- Stream generated binary or text payload as a downloadable HTTP response
- Set correct Content-Type for PDF or Excel/CSV based on Bufdir format requirements
- Apply Content-Disposition header with a filename derived from period and organization
Interfaces
streamFile(payload: Buffer, filename: string, mimeType: string, res: Response): void
buildFilename(organizationId: string, periodId: string, format: string): string