这是我用来下载文件的代码
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();
我收到带有 SignatureDoesNotMatch 代码的 403 错误。我究竟做错了什么?