save to upload folder only when option enabled
This commit is contained in:
6
app.js
6
app.js
@@ -406,8 +406,10 @@ app.get('/me', function (req, res) {
|
|||||||
app.post('/uploadimage', function (req, res) {
|
app.post('/uploadimage', function (req, res) {
|
||||||
var form = new formidable.IncomingForm();
|
var form = new formidable.IncomingForm();
|
||||||
|
|
||||||
form.uploadDir = "public/uploads";
|
if (config.imageUploadType === 'filesystem') {
|
||||||
form.keepExtensions = true;
|
form.uploadDir = "public/uploads";
|
||||||
|
form.keepExtensions = true;
|
||||||
|
}
|
||||||
|
|
||||||
form.parse(req, function (err, fields, files) {
|
form.parse(req, function (err, fields, files) {
|
||||||
if (err || !files.image || !files.image.path) {
|
if (err || !files.image || !files.image.path) {
|
||||||
|
|||||||
Reference in New Issue
Block a user