Answers for "node download s3 file"

1

node download s3 file

const AWS = require('aws-sdk');
AWS.config.update(
  {
    accessKeyId: "....",
    secretAccessKey: "...",
    region: 'ap-southeast-1'
  }
);
const s3 = new AWS.S3();
const options = {
  Bucket    : '/bucket-url',
  Key    : fileKey,
};
const fileStream = s3.getObject(options).createReadStream();
fileStream.pipe(res);
Posted by: Guest on December-11-2020

Code answers related to "node download s3 file"

Code answers related to "Javascript"

Browse Popular Code Answers by Language