Quantcast
Channel: How can I move (not copy) a file in AWS S3 using their sdk? - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Klaycon for How can I move (not copy) a file in AWS S3 using their sdk?

$
0
0

Based on the answer here: AWS S3 - Move an object to a different folder in which user @Michael-sqlbot comments:

That's because S3, itself, doesn't have an atomic move or rename operation... so there isn't really an alternative

And the docs here: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/examples-s3-objects.html#copy-object (for the Java SDK, but seems to be useful here) which notes:

You can use copyObject with deleteObject to move or rename an object, by first copying the object to a new name (you can use the same bucket as both the source and destination) and then deleting the object from its old location.

It sounds like S3's infrastructure simply doesn't support moving or renaming in a single operation. You must copy, then delete.


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>