X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2Ffiles.js;h=1af4a18a3ece1f215342cd2b90fda8fa871d28ff;hb=f66b47bd92369aa3c289a8f08de98e7e2ba7b2b0;hp=876ff4e96798b938708cec8dfca372b8e39b56d5;hpb=789485e5fbe923f351f2d94ace48561073223ae5;p=perso%2FImmae%2FProjets%2FNodejs%2FSurfer.git 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) {