diff --git a/lib/cloudfiles/container.js b/lib/cloudfiles/container.js index f715481..5ba9b6f 100644 --- a/lib/cloudfiles/container.js +++ b/lib/cloudfiles/container.js @@ -12,6 +12,9 @@ var Container = exports.Container = function (client, details) { if (!details) { throw new Error("Container must be constructed with at least basic details.") } + if(typeof details !== 'object') { + details = {name: details}; + } this.files = []; this.client = client; @@ -20,7 +23,16 @@ var Container = exports.Container = function (client, details) { Container.prototype = { addFile: function (file, local, options, callback) { - return this.client.addFile(this.name, file, local, options, callback); + if(!options && !callback) { + options = {}; + } + if (typeof options === 'function' && !callback) { + callback = options; + options = {}; + } + options.remote = file; + options.local = local; + return this.client.addFile(this.name, options, callback); }, destroy: function (callback) {