How do I copy an object with presigned URL?

前端 未结 2 414
花落未央
花落未央 2021-01-20 23:56

I\'m using a service that puts the data I need on S3 and gives me a list of presigned URLs to download (http://.s3.amazonaws.com/?AWSAccessKeyID=...&Signa

相关标签:
2条回答
  • 2021-01-21 00:30

    You can't do this with a signed url, but as has been mentioned, if you fetch and upload within EC2 in an appropriate region for the buckets in question, there's essentially no additional cost.

    Also worth noting, both buckets do not have to be in the same account, but the aws key that you use to make the request have to have permission to put the target object and get the source object. Permissions can be granted across accounts... though in many cases, that's unlikely to be granted.

    http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectCOPY.html

    0 讨论(0)
  • 2021-01-21 00:37

    You actually can do a copy with a presigned URL. To do this, you need to create a presigned PUT request that also includes a header like x-amz-copy-source: /sourceBucket/sourceObject in order to specify where you are copying from. In addition, if you want the copied object to have new metadata, you will also need to add the header x-amz-metadata-directive: REPLACE. See the REST API documentation for more details.

    0 讨论(0)
提交回复
热议问题