mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 11:53:23 +02:00
add filesystem support(without frontend)
This commit is contained in:
@@ -138,6 +138,10 @@ module.exports = function(options) {
|
||||
app.get('/s/blob/:id/:name', function(req, res) {
|
||||
var file = storage.retrieve(req.params.id)
|
||||
if (file) {
|
||||
if (typeof req.query.download !== 'undefined') {
|
||||
res.set('Content-Disposition',
|
||||
'attachment; filename="' + path.basename(file.name) + '"')
|
||||
}
|
||||
res.set('Content-Type', file.type)
|
||||
res.sendFile(file.path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user