diff options
author | Yukai Huang | 2016-11-14 16:45:57 +0800 |
---|---|---|
committer | Yukai Huang | 2016-11-14 16:45:57 +0800 |
commit | 81b368c11c81c7c759d4abcdff455121f2e87d9a (patch) | |
tree | cd97261147a47b438ccb0ce12e1c4491aa081ec3 /app.js | |
parent | a04c6ef127f5982eec5353e1468ef881fbac03ea (diff) |
upload image to public/uploads
Diffstat (limited to 'app.js')
-rw-r--r-- | app.js | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -405,6 +405,9 @@ app.get('/me', function (req, res) { //upload to imgur app.post('/uploadimage', function (req, res) { var form = new formidable.IncomingForm(); + form.uploadDir = "public/uploads"; + form.keepExtensions = true; + form.parse(req, function (err, fields, files) { if (err || !files.image || !files.image.path) { response.errorForbidden(res); |