Amazon S3中的重复文件

bal*_*dre 7 c# amazon-s3

我正在尝试将文件从存储桶复制到另一个存储区,但我无法查找目标存储桶上的新文件.

完全没有错误 ......

请求:

在此输入图像描述

响应:

<?xml version="1.0" encoding="UTF-8"?>
<CopyObjectResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <LastModified>2012-04-08T11:26:36.000Z</LastModified
    <ETag>&quot;a5f9084078981b64737b57dbf1735fcf&quot;</ETag>
</CopyObjectResult>
Run Code Online (Sandbox Code Playgroud)

但我一直在检查S3上的上次修改日期,我找不到有关这个新文件的任何信息,要么我可以直接访问它

http://jk-v20.s3.amazonaws.com/PublicFiles/3ff28e21-4801-47c6-a6d0-e370706d303f_Content_Favicon.ico

我究竟做错了什么?


方法:

public void DuplicateFileInCloud(string original, string destination)
{
    try
    {
        CopyObjectRequest request = new CopyObjectRequest();

        if (original.StartsWith("http"))
        {
            // could be from other bucket, URL will show all data
            // example: http://jk-v30.s3.amazonaws.com/PredefinedFiles/Favicons/002.ico
            string bucket = getBucketNameFromUrl(original), // jk-v30
                    key = getKeyFromUrl(original);          // PredefinedFiles/Favicons/002.ico

            request.WithSourceBucket(bucket);
            request.WithSourceKey(key);
        }
        else
        {
            // same bucket: copy/paste operation
            request.WithSourceBucket(this.bucketName);
            request.WithSourceKey(original);
        }

        request.WithDestinationBucket(this.bucketName);
        request.WithDestinationKey(destination);
        request.CannedACL = S3CannedACL.PublicRead;

        using (AmazonS3 client = Amazon.AWSClientFactory.CreateAmazonS3Client(this.accessKey, this.secretAccessKey))
        {
            S3Response response = client.CopyObject(request);
            response.Dispose();
        }
    }
    catch (AmazonS3Exception s3Exception)
    {
        throw s3Exception;
    }
}
Run Code Online (Sandbox Code Playgroud)

Tom*_*sen 6

http://jk-v20.s3.amazonaws.com//PublicFiles/3ff28e21-4801-47c6-a6d0-e370706d303f_Content_Favicon.ico

是文件的位置.(注意双斜杠.// ..)如果你点击这个Url,你会看到ico文件.所以它与前导斜杠有关,可以由您的工具集自动添加.