fix #354
This commit is contained in:
parent
15346c9a00
commit
7deb3745bf
1 changed files with 2 additions and 3 deletions
|
@ -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}` });
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue