I\'m writing an application which downloads images from a url and then uploads it to an S3 bucket using the aws-sdk.
Perviously I was just downloading images and sav
This is what I did and works nicely:
const request = require('request-promise')
const AWS = require('aws-sdk')
const s3 = new AWS.S3()
const options = {
uri: uri,
encoding: null
};
async load() {
const body = await request(options)
const uploadResult = await s3.upload({
Bucket: 'bucket_name',
Key : path,
Body : body,
}).promise()
}