Quick way to list all files in Amazon S3 bucket?

前端 未结 28 1846
星月不相逢
星月不相逢 2020-11-28 01:32

I have an amazon s3 bucket that has tens of thousands of filenames in it. What\'s the easiest way to get a text file that lists all the filenames in the bucket?

28条回答
  •  臣服心动
    2020-11-28 01:57

    public static Dictionary ListBucketsByCreationDate(string AccessKey, string SecretKey)  
    {  
    
        return AWSClientFactory.CreateAmazonS3Client(AccessKey,
            SecretKey).ListBuckets().Buckets.ToDictionary(s3Bucket => s3Bucket.BucketName,
            s3Bucket => DateTime.Parse(s3Bucket.CreationDate));
    
    }
    

提交回复
热议问题