Created
April 1, 2015 13:30
-
-
Save shino/602caae62725a82c559c to your computer and use it in GitHub Desktop.
List Parts of Multipat Upload Example by node.js with aws-sdk-js
This file contains 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
"use strict"; | |
var AWS = require('aws-sdk'); | |
var region = process.argv[2]; | |
var bucket = process.argv[3]; | |
var key = process.argv[4]; | |
var uploadId = process.argv[5]; | |
AWS.config.update({region: region, | |
sslEnabled: false}); | |
var s3 = new AWS.S3(); | |
var globalUnCaughtException = function(err) { | |
console.log("uncaughtException: ", err.stack); | |
}; | |
process.on('uncaughtException', globalUnCaughtException); | |
s3.listParts({Bucket: bucket, Key: key, UploadId: uploadId}). | |
on('httpHeaders', function(statusCode, headers) { | |
process.stdout.write("statusCode: " + statusCode.toString() + '\n'); | |
process.stdout.write("headers:\n"); | |
process.stdout.write(JSON.stringify(headers, null, 4)); | |
process.stdout.write("\n===========\n"); | |
}). | |
on('httpData', function(chunk) { process.stdout.write(chunk); }). | |
send(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment