I am trying to download a fairly large file (500MB) from an NodeJS API endpoint, but the following code appears times out with a 504 Gateway Timeout:
async download(res: Response) {
const path = `${this.EXCEL_SAVE_DIR}/report.xlsx`;
try {
if (fs.existsSync(path)) {
res.download(path);
} else {
logger.debug(`download -> file not found at: ${path} `);
}
} catch (err) {
logger.debug(`download -> error: ${JSON.stringify(err)}`);
}
}
Is it possible to avoid these timeouts?