S3Client.ListObjects return only 1000 of objects. How to retrieve list of all existing objects using Amazon C# library?
Be aware that the answer above is not using the recommended API to List Objects: http://docs.aws.amazon.com/AmazonS3/latest/API/v2-RESTBucketGET.html
The following snippet shows how it looks with the new API:
using (var s3Client = new AmazonS3Client(Amazon.RegionEndpoint.USEast1))
{
ListObjectsV2Request request = new ListObjectsV2Request
{
BucketName = bucketName,
MaxKeys = 10
};
ListObjectsV2Response response;
do
{
response = await s3Client.ListObjectsV2Async(request);
// Process response.
// ...
request.ContinuationToken = response.NextContinuationToken;
} while (response.IsTruncated);
}