mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 15:53:23 +02:00
Add download query parameter to download images as attachment.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user