Skip to content

Commit

Permalink
Uploaded file info
Browse files Browse the repository at this point in the history
  • Loading branch information
sakno committed Dec 2, 2011
1 parent 7f744bd commit 7183816
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/knox/client.js
Expand Up @@ -534,6 +534,19 @@ Client.prototype.headFile = function(filename, headers, fn){
}).end();
};

/**
* Obtains information about uploaded object.
* @param {String} filename
* @param {Object|Function} headers
* @param {Function} fn
*/
Client.prototype.fileInfo = function(filename, headers, fn){
this.headFile(filename, headers, function(res){
if(res.statusCode == 200) fn({'etag': JSON.parse(res.headers['etag']), 'size': JSON.parse(res.headers['content-length']), 'modified': res.headers['last-modified']});
else fn(null);
});
};

/**
* DELETE `filename` with optional `headers.
*
Expand Down

0 comments on commit 7183816

Please sign in to comment.