Skip to content

Instantly share code, notes, and snippets.

@chetandhembre
Created April 14, 2014 13:25
Show Gist options
  • Save chetandhembre/10647592 to your computer and use it in GitHub Desktop.
Save chetandhembre/10647592 to your computer and use it in GitHub Desktop.
Upload file to s3 using intimidate
var Intimidate = require('intimidate');
var s3Uploader = function(options) {
try {
this.client = new Intimidate(options);
} catch (e) {
return null;
}
};
s3Uploader.prototype.uploadBuffer = function(buffer, headers, destination, callback) {
this.client.uploadBuffer(buffer, headers, destination, function(err, res, timesRetried) {
console.log(response.result); //returns url of uploaded file
callback(err, res, timesRetried);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment