This commit is contained in:
Raymond Camden 2017-02-02 09:19:28 -06:00
parent 907f83ac3a
commit ec959d2c38
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}

View File

@ -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);