import { Response } from 'express' ; export function sendFile ( res , mime , filename = '' , buffer , bufferLength ? ) { res . writeHead ( 200 , { 'Content-Type' : mime , 'Content-disposition' : `attachment; filename="${ filename }"` , 'Content-Length' : bufferLength || buffer . length , } ) ; res . end ( buffer ) ; }