diff --git a/lib/providers/filesystem/index.js b/lib/providers/filesystem/index.js index a941587..6dcc5fd 100644 --- a/lib/providers/filesystem/index.js +++ b/lib/providers/filesystem/index.js @@ -124,6 +124,8 @@ FileSystemProvider.prototype.getContainers = function(cb) { FileSystemProvider.prototype.createContainer = function(options, cb) { var self = this; var name = options.name; + var hasSlash = (typeof name == 'string' ? name.search('%2F') : false); + name = (hasSlash != -1 ? name.replace(/%2F/gi, '/') : name); var dir = path.join(this.root, name); validateName(name, cb) && fs.mkdir(dir, options, function(err) { if (err) { @@ -180,12 +182,8 @@ FileSystemProvider.prototype.getContainer = function(containerName, cb) { // File related functions FileSystemProvider.prototype.upload = function(options, cb) { var container = options.container; - if (!validateName(container)) { - return writeStreamError( - new Error(g.f('{{FileSystemProvider}}: Invalid name: %s', container)), - cb - ); - } + var hasSlash = (typeof container == 'string' ? container.search('%2F') : false); + container = (hasSlash != -1 ? container.replace(/%2F/gi, '/') : container); var file = options.remote; if (!validateName(file)) { return writeStreamError(