Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to use copyObject function to copy a Json file from one s3 bucket to other s3 bucket.

Example: A file /accounts/abc.json in bucket credit-account has to be copied to another bucket named debit-account

I hardcoded the parameters to be

sourcebucket = “Credit-account”
Sourcekey = “/accounts/abc.json”
Target bucket = “debut-account”
Target key = “abc.txt”

Cooyobject is throwing error

the specified key does not exist

Can you please suggest the possible reasons? or things to be verified?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
376 views
Welcome To Ask or Share your Answers For Others

1 Answer

The source key's first URL part is the bucket. So your source key should be something like that:

Sourcekey = “Credit-account/accounts/abc.json”

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...