diff --git a/lib/dbox.js b/lib/dbox.js index d39a258..9a4316d 100644 --- a/lib/dbox.js +++ b/lib/dbox.js @@ -195,6 +195,35 @@ exports.app = function(config){ }) }, + put_stream: function(path, stream, length, args, cb){ + if(!cb){ + cb = args + args = null + } + + var signature = helpers.sign(options, args) + + var url = helpers.url({ + hostname: "api-content.dropbox.com", + action: "files_put", + path: path, + query: signature + }) + + var args = { + "method": "PUT", + "url": url + } + + if (length) args.headers = { "content-length": length } + + return stream.pipe( + request(args, function(e, r, b){ + cb(e, e ? r : helpers.parseJSON(b)) + }) + ) + }, + metadata: function(path, args, cb){ if(!cb){ cb = args