diff --git a/storage/file.js b/storage/file.js index b25a5c99f..7503791a8 100644 --- a/storage/file.js +++ b/storage/file.js @@ -37,8 +37,7 @@ var checkPath = function (path, callback) { callback(err); return; } - var dirPath = path.replace(/\/[^\/]*$/, '/'); - Fs.mkdir(dirPath, function (err) { + Fs.mkdir(Path.dirname(path), function (err) { if (err && err.code !== 'EEXIST') { callback(err); return;