From b19c3ed51f13857a60c3b5a7d8bfbd55d3166b81 Mon Sep 17 00:00:00 2001 From: Aaron Levine Date: Mon, 16 Oct 2017 20:18:36 -0400 Subject: [PATCH] Fixed in Adapters.FS --- lib/storage/adapters/fs/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/storage/adapters/fs/index.js b/lib/storage/adapters/fs/index.js index 72ee5bd09e..91193944cb 100644 --- a/lib/storage/adapters/fs/index.js +++ b/lib/storage/adapters/fs/index.js @@ -97,7 +97,9 @@ FSAdapter.prototype.uploadFile = function (file, callback) { filename = sanitize(filename); debug('Uploading file with filename: %s', filename); var uploadPath = path.resolve(options.path, filename); - fs.move(file.path, uploadPath, function (err) { + var fsOptions = {}; + fsOptions.clobber = options.whenExists === 'overwrite'; + fs.move(file.path, uploadPath, fsOptions, function (err) { if (err) return callback(err); // TODO: Chmod the file.