How to create a new S3 bucket in AWS using nodejs?
I need to upload a large number of the image file on the s3 bucket for ease of using and manage the storage space on the cloud instead of my local server storage.
Try this
var params = {
Bucket: "examplebucket",
CreateBucketConfiguration: {
LocationConstraint: "eu-west-1"
}
};
s3.createBucket(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
For more info read this link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With