From 8db6624ae99ed23485213e68bfb41b76af4b4fc5 Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Tue, 15 Nov 2016 23:25:41 +0800 Subject: save to upload folder only when option enabled --- app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index f5f8a3a5..b67c77c2 100644 --- a/app.js +++ b/app.js @@ -406,8 +406,10 @@ app.get('/me', function (req, res) { app.post('/uploadimage', function (req, res) { var form = new formidable.IncomingForm(); - form.uploadDir = "public/uploads"; - form.keepExtensions = true; + if (config.imageUploadType === 'filesystem') { + form.uploadDir = "public/uploads"; + form.keepExtensions = true; + } form.parse(req, function (err, fields, files) { if (err || !files.image || !files.image.path) { -- cgit v1.2.3