diff options
author | Yukai Huang | 2016-11-15 23:25:41 +0800 |
---|---|---|
committer | Yukai Huang | 2016-11-15 23:25:41 +0800 |
commit | 8db6624ae99ed23485213e68bfb41b76af4b4fc5 (patch) | |
tree | f91aec35683e3eacf0becdc27b116e8b5f911819 | |
parent | a5dad2930037b466542f1e77d3cbb0d0cbf184aa (diff) |
save to upload folder only when option enabled
Diffstat (limited to '')
-rw-r--r-- | app.js | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) { |