Class FileDownloadHandlerAbstract
Properties
Protected
Readonly
directoryArchiver
Protected
Readonly
fileDownloadCache
Protected
Readonly
logger
logger: ILogger
Methods
Protected
archive
- archive(inputPath, outputPath?, entries?): Promise<string>
Parameters
- inputPath: string
- outputPath: string = ...
Optional
entries: string[]
Returns Promise<string>
Protected
createTempDir
- createTempDir(downloadId?): Promise<string>
Returns Promise<string>
Protected
download
- download(request, response, downloadInfo, id): Promise<void>
Parameters
- request: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
- response: Response<any, Record<string, any>>
- downloadInfo: DownloadStorageItem
- id: string
Returns Promise<void>
Abstract
handle
- handle(request, response): Promise<void>
Parameters
- request: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
- response: Response<any, Record<string, any>>
Returns Promise<void>
Protected
handleError
- handleError(response, reason, status?): Promise<void>
Parameters
- response: Response<any, Record<string, any>>
- reason: string | Error
- status: number = INTERNAL_SERVER_ERROR
Returns Promise<void>
Protected
parseRangeHeader
- parseRangeHeader(range, statSize): undefined | {
end: number;
start: number;
} Parameters
- range: undefined | string | string[]
- statSize: number
Returns undefined | {
end: number;
start: number;
}
Protected
prepareDownload
- prepareDownload(request, response, options): Promise<void>
Parameters
- request: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
- response: Response<any, Record<string, any>>
- options: PrepareDownloadOptions
Returns Promise<void>
Protected
streamDownload
- streamDownload(status, response, stream, id): void
Parameters
- status: number
- response: Response<any, Record<string, any>>
- stream: ReadStream
- id: string
Returns void
Prepares the file and the link for download