From f66b47bd92369aa3c289a8f08de98e7e2ba7b2b0 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Fri, 7 Apr 2017 16:49:43 +0200 Subject: Add file download button --- src/files.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/files.js') diff --git a/src/files.js b/src/files.js index 876ff4e..1af4a18 100644 --- a/src/files.js +++ b/src/files.js @@ -88,7 +88,7 @@ function get(req, res, next) { debug('get', absoluteFilePath); if (!result.isDirectory() && !result.isFile()) return next(new HttpError(500, 'unsupported type')); - if (result.isFile()) return res.sendFile(absoluteFilePath); + if (result.isFile()) return res.download(absoluteFilePath); async.map(fs.readdirSync(absoluteFilePath), function (filePath, callback) { fs.stat(path.join(absoluteFilePath, filePath), function (error, result) { -- cgit v1.2.3