Here's the code I'm using to download a file
var S3_KEY = 'xxxxxx';
var S3_SECRET = 'xxxxxx';
var S3_BUCKET = 'xxxxxx';
var s3Client = require('knox').createClient({
"key": S3_KEY,
"secret": S3_SECRET,
"bucket": S3_BUCKET
});
// Pull some stuff down
s3Client.get('myFile.zip').on( 'response', function(res){
console.log( "\n" + res.statusCode );
console.log( "\n" + res.headers + "\n" );
res.setEncoding( 'utf8' );
res.on('data', function( chunk ) {
console.log( chunk );
});
}).end();
I'm getting a 403 error with a SignatureDoesNotMatch code. What am I doing wrong?
You might want to look at the AwsSum library. It's fully-featured and actively maintained:
And there is an example of downloading from S3 in the node-awssum-scripts repo which you might find useful:
Give me a shout if you need any help. Disclaimer: I'm chilts, author of AwsSum. :)
It seems like this is an issue on Knox's end. Apparently the problem has been solved, but the solution has not not pulled into the main project yet.
See this thread: https://github.com/LearnBoost/knox/issues/56
My workaround was to just remove the knox library and clone this repository into my node_modules folder: https://github.com/domenic/knox.git