When I upload a file using $container->uploadObjects($files)
I can include the directory path in the name to make a new folder. If I use Cyberduck I can see the new folder.
But if I try and get an object list with $container->objectList($options)
it doesn’t list the directory like [content_type] => application/directory
. But it does when I use Cyberduck.
So my question is, how do I create a folder using php-opencloud?
Advertisement
Answer
This is not related to php-opencloud specifically, but it’s a limitation of CloudFiles. Much like AWS S3 and other distributed object stores, you can’t have directories inside buckets. Some software, like Cyberduck, knows that and instead it renames the files with the hierarchy as well as displaying those hierarchy as directories even though they are all in the same level of a container. For detailed explanation, check this documentation out.