diff --git a/lib/storage-handler.js b/lib/storage-handler.js index 1141681..3b27845 100644 --- a/lib/storage-handler.js +++ b/lib/storage-handler.js @@ -85,7 +85,7 @@ exports.upload = function(provider, req, res, options, cb) { if ('function' === typeof options.getFilename) { file.originalFilename = file.name; file.name = options.getFilename(file, req, res); - } else if(options.nameConflict === "makeUnique") { + } else if (options.nameConflict === 'makeUnique') { file.originalFilename = file.name; file.name = uuid.v4() + path.extname(file.name); } diff --git a/lib/storage-service.js b/lib/storage-service.js index 9a67be8..834639d 100644 --- a/lib/storage-service.js +++ b/lib/storage-service.js @@ -46,7 +46,7 @@ function StorageService(options) { if (options.maxFileSize) { this.maxFileSize = options.maxFileSize; } - if(options.nameConflict) { + if (options.nameConflict) { this.nameConflict = options.nameConflict; } } @@ -244,7 +244,7 @@ StorageService.prototype.upload = function(req, res, options, cb) { if (this.maxFileSize && !options.maxFileSize) { options.maxFileSize = this.maxFileSize; } - if(this.nameConflict && !options.nameConflict) { + if (this.nameConflict && !options.nameConflict) { options.nameConflict = this.nameConflict; } return handler.upload(this.client, req, res, options, cb);