diff options
author | Johannes Zellner <johannes@cloudron.io> | 2017-04-07 16:49:43 +0200 |
---|---|---|
committer | Johannes Zellner <johannes@cloudron.io> | 2017-04-07 16:49:43 +0200 |
commit | f66b47bd92369aa3c289a8f08de98e7e2ba7b2b0 (patch) | |
tree | ed0110fe18bb461921d357fa471d346770739e02 /src | |
parent | 789485e5fbe923f351f2d94ace48561073223ae5 (diff) | |
download | Surfer-f66b47bd92369aa3c289a8f08de98e7e2ba7b2b0.tar.gz Surfer-f66b47bd92369aa3c289a8f08de98e7e2ba7b2b0.tar.zst Surfer-f66b47bd92369aa3c289a8f08de98e7e2ba7b2b0.zip |
Add file download button
Diffstat (limited to 'src')
-rw-r--r-- | src/files.js | 2 |
1 files changed, 1 insertions, 1 deletions
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) { | |||
88 | debug('get', absoluteFilePath); | 88 | debug('get', absoluteFilePath); |
89 | 89 | ||
90 | if (!result.isDirectory() && !result.isFile()) return next(new HttpError(500, 'unsupported type')); | 90 | if (!result.isDirectory() && !result.isFile()) return next(new HttpError(500, 'unsupported type')); |
91 | if (result.isFile()) return res.sendFile(absoluteFilePath); | 91 | if (result.isFile()) return res.download(absoluteFilePath); |
92 | 92 | ||
93 | async.map(fs.readdirSync(absoluteFilePath), function (filePath, callback) { | 93 | async.map(fs.readdirSync(absoluteFilePath), function (filePath, callback) { |
94 | fs.stat(path.join(absoluteFilePath, filePath), function (error, result) { | 94 | fs.stat(path.join(absoluteFilePath, filePath), function (error, result) { |