How to rename files and folder in Amazon S3?

后端 未结 19 2327
暖寄归人
暖寄归人 2020-11-28 03:01

Is there any function to rename files and folders in Amazon S3? Any related suggestions are also welcome.

19条回答
  •  粉色の甜心
    2020-11-28 03:29

    Here's how you do it in .NET, using S3 .NET SDK:

    var client = new Amazon.S3.AmazonS3Client(_credentials, _config);
    client.CopyObject(oldBucketName, oldfilepath, newBucketName, newFilePath);
    client.DeleteObject(oldBucketName, oldfilepath);
    

    P.S. try to use use "Async" versions of the client methods where possible, even though I haven't done so for readability

提交回复
热议问题