Created
April 14, 2014 13:25
-
-
Save chetandhembre/10647592 to your computer and use it in GitHub Desktop.
Upload file to s3 using intimidate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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