This commit is contained in:
Cassie Tarakajian 2017-05-13 22:23:07 -04:00
parent 15346c9a00
commit 7deb3745bf

View file

@ -93,15 +93,14 @@ export function copyObjectInS3(req, res) {
const params = {
Bucket: `${process.env.S3_BUCKET}`,
CopySource: `${process.env.S3_BUCKET}/${objectKey}`,
Key: `${userId}/${newFilename}`
Key: `${userId}/${newFilename}`,
ACL: 'public-read'
};
const copy = client.copyObject(params);
copy.on('err', (err) => {
console.log('in error');
console.log(err);
});
copy.on('end', (data) => {
console.log(data);
res.json({ url: `${s3Bucket}${userId}/${newFilename}` });
});
}