Google Cloud Storage folders list with PHP on App

2019-06-04 23:48发布

问题:

I have been trouble looking a solution to get listed of Google Cloud Storage Folders list with PHP on App Engine without using GCS PHP API.

  • I know that there is PHP API for this...

  • I know that it is only listing files when (readdir, opendir and other PHP dir methods) but skipped any folder...

Can somebody guide me with a tips, my question is that how do I get listed anything on a particular folder?

回答1:

There is no such thing as a 'folder' on GCS - it is a flat file system.

Folders are simulated in the UI + APIs but treating files with a '/' in the name as part of a folder structure.

That being said, the gcs stream wrapper provided with App Engine should support opendir(), readdir(), closedir() on a Cloud Storage bucket and make it look like it's listing a folder. How is this not working for you?