I need to save file in S3 Digital Ocean space by URL. It can't be downloaded and then saved to S3, because we use firebase-functions, and there restricted to use file system. Is there way to save it directly from url or other ways? For example by stream?
const fileName = 'image.jpg';
const url = 'imageUrl';
const res = await https.get(url, (stream) => stream.pipe(res));
await s3
.upload({
Bucket: 'name',
Key: `content/${fileName}`,
Body: res,
ACL: 'public-read'
})
.promise();