#Cloud Storage Plugin: Nesting a document in dynamic subdirectories

5 messages · Page 1 of 1 (latest)

rose sentinel
#

I am currently using the S3 adapter for handling documents for our clients. We are using a multi tenant structure for our CMS and therefore have many different clients accessing the same documents collection. As far as I have tested, the file is stored in AWS as the filename. I have prepended the client ID to the front of the filename (123...ABC/file_name.png) so that the file is stored in documents > client ID > filename and there are no conflict in our S3 bucket. It also allows the client docs to be segregated. The structure is right in S3 (pic 1) but the server can't locate the file because it says the key in invalid.

The prefix in my config is "documents" to match my collection (pic 2). It seems like payload cannot access a nested directory starting at the prefix directory. If I change the prefix to a specific client ("documents/123...ABC") it works, but I would rather not make separate collections for each clients documents just so that the prefix matches.

Lastly, even the key in AWS matches the URL but I still get an error saying the key is invalid (pic 3, 4, 5).

royal parrot
#

This might not help, but in my own configuration of a custom prefix I included a / at the end of the pathname

#

so like prefix: 'media/',

rose sentinel
sick viper
#

Hey @rose sentinel did you find a solution here? do you still need help?