Skip to content

Commit 4853176

Browse files
author
Pablo Andres Dorado Suarez
committed
Bugfix- Execute callback in case folder exists
1 parent 7ac85c9 commit 4853176

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ var multer = new Multer({
1313
destination: function (req, file, cb) {
1414
var dest = path.join(PATH, 'static');
1515
fs.exists(dest, function (exists) {
16-
if(!exists) fs.mkdir(dest, function (err) {
16+
if(!exists) return fs.mkdir(dest, function (err) {
1717
if(!err) cb(null, dest);
1818
});
19+
cb(null, dest);
1920
});
2021
},
2122
filename: function (req, file, cb) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "booljs-multer",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "RouteMiddleware to allow developers support file uploads in their APIs",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)