We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to configure AmasonS3FileProvider to use a Key prefix

Please help me understand how to configure the AmazonS3FileProvider to pick the folder where files live. Within my bucket, I have 2 "folders" (i.e. prefixes), dev​ and prod​, each containing a file tree for FileManager. My app switches between these 2 environments, depending on environment variables at runtime. Under dev & prod, there is a single nested folder named fileservice where I want FileManager files to live.

The S3 bucket is structured like this:

---
|-dev/
| |-fileservice/
| | |-dir1/
| | | |-file1
| | | |-file2
| | | | ...
| | |-dir2/
|
|-prod/
| |-fileservice/
| | |-dir1/
| | |-dir2/ ---

I see that GetBucketList() instructs me to "Define the root directory to the file manager", but I have not been able to get it to work. Below seems correct-looking, but doesn't work.

---
{
ListingObjectsAsync("/", "dev/fileservice/", false).Wait();
RootName = response.S3Objects.First().Key;
}

---


I've tried as many permutations as I can think of (with/without slashes, with/without each segment of path, etc), but I can't get it to work.

Help!


Loader.
Live Chat Icon For mobile
Up arrow icon