I’m currently listing my root objects as:
var files = new List<string>();
var request = new ListObjectsRequest();
request.WithBucketName(bucketName);
try
{
using (AmazonS3 client = Amazon.AWSClientFactory.CreateAmazonS3Client(this.accessKey, this.secretAccessKey))
using (ListObjectsResponse r = client.ListObjects(request))
foreach (var o in r.S3Objects)
//o.ETag, o.Key, o.StorageClass, o.Size
if (o.Size > 0)
files.Add(o.Key);
}
catch (Exception ex)
{
// log exception
}
in o.Key there’s the file name, but I would like to get the public path for this file name and I don’t seam to find help on getting such reference to an existing file.
I normally use the Public Bucket url inside the configuration file, but I was wondering if I can avoid such configuration and actually get that from the Object itself upon retrieval.
found out that is a little easier as Amazon S3 follows a convention:
this will be the public path.