This Meteor code needs to push a file collected from the internet to my S3 bucket.
So I am testing it locally before updating the server which is running in a docker container EC2.
edit
The file I am trying to push is located locally in the same folder as the code file. After running the code, I now can see the file in the S3 bucket but its size is 0.
How can I actually upload the file so that a copy is saved in the bucket? thanks
let s3 = new AWS.S3();
let params = {
Bucket: "my-bucket-name",
Key: "myfile.pdf",
};
s3.putObject(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // => { ETag: '"d41d8...27e"' }
});