1
0
Fork 0
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:
Gunther Brunner 2014-10-01 17:53:30 +09:00
parent 54ad605592
commit cd92078043

View file

@ -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) {