Created
August 9, 2017 15:05
-
-
Save scripting/5fae68dd05a27ef595a916e75b7be773 to your computer and use it in GitHub Desktop.
Hello world for S3 in JavaScript
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 AWS = require ("aws-sdk"); | |
var s3 = new AWS.S3 (); | |
const params = { | |
Bucket: "bloatware.org", | |
Key: "/testing/hello.txt", | |
Body: "Hello World", | |
ContentType: "text/plain", | |
ACL: "public-read" | |
}; | |
s3.putObject (params, function (err, data) { | |
if (err) { | |
console.log ("\nThere was an error: " + err.message + "\n"); | |
} | |
else { | |
console.log ("\nEverything's good. This is the data that was returned by AWS: \n\n" + JSON.stringify (data, undefined, 4) + "\n"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This example goes with this question.
scripting/Scripting-News#19 (comment)
Dave