for my project I need to list all files within a bucket on a one hand to process them, on the other to upload new files with accordingly incremented filenames. At this point I am totally flexible in terms of incrementing either keys or the filenames, to provide unique identification for all stored items.
For now I am able to create new buckets, theoretically add there keys and store there files, but I am not able to list all those keys and filenames, that’s why theoretically.
Appreciate any help
In addition, it’s quite interesting, how do you access and display the whole structure in the web client. There are buckets, folders assigned to those buckets and files within those folders.
First of all - there is no folders and files
The “folders” (prefixes divided by slashes) is a part of the object key (name).
To list all objects in the provided bucket you can use uplink CLI:
uplink ls --recursive sj://my-bucket
You can check the code, how the --recursive implemented and can use the similar approach in your code.
The way to upload a folder with files to the bucket: