mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
Add download query parameter to download images as attachment.
This commit is contained in:
parent
54ad605592
commit
cd92078043
1 changed files with 6 additions and 0 deletions
|
@ -31,6 +31,12 @@ module.exports = function(options) {
|
|||
})
|
||||
.then(function(out) {
|
||||
res.status(200)
|
||||
|
||||
if (typeof req.query.download !== 'undefined') {
|
||||
res.set('Content-Disposition',
|
||||
'attachment; filename="' + req.params['0'] + '"')
|
||||
}
|
||||
|
||||
out.pipe(res)
|
||||
})
|
||||
.catch(function(err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue