Now, whenever someone requests a backup file, it will automatically suggest a default file name for the downloaded file.

This commit is contained in:
mfcar 2023-09-19 22:37:57 +01:00
parent 9967a5dc66
commit 9519f6418d
No known key found for this signature in database

View File

@ -42,6 +42,9 @@ class BackupController {
Logger.debug(`Use X-Accel to serve static file ${encodedURI}`)
return res.status(204).header({ 'X-Accel-Redirect': encodedURI }).send()
}
res.setHeader('Content-disposition', 'attachment; filename=' + req.backup.filename)
res.sendFile(req.backup.fullPath)
}
@ -65,4 +68,4 @@ class BackupController {
next()
}
}
module.exports = new BackupController()
module.exports = new BackupController()