How to copy the object from s3 to s3 using node.js

后端 未结 4 883
小蘑菇
小蘑菇 2021-02-19 13:04

I would like to know how to copy the object from s3 to s3 using node.js With the aws s3 command, It could be executed as follows.

s3 cp --recursive s3://xx/yy  s         


        
4条回答
  •  梦毁少年i
    2021-02-19 13:34

    s3.copyObject({ Bucket, CopySource: `/${Bucket}/${Key}?versionId=${versionId}`, Key, }).promise() if you do pass a versionId this is what it looks like.

    took me longer than i'd care to admit to figure out.

提交回复
热议问题