I'm new to app engine and trying to list objects from storage. Can you please help me with below?
I use php72
Below code correctly list objects. But how can I list objects with created date? My requirement is to list objects in a table with created date one column and latest first.
Google\Cloud\Storage\StorageClient;
$bucketNm ="abc";
$userFolder = "mfolder"
$bucket = $storage->bucket($bucketNm);
$options = ['prefix' => $userFolder];
foreach ($bucket->objects($options) as $object) {
echo $object->name();
}
Actually I found a way to get other info of the object.
$info = $object->info();
I'm going to add data in to a multidimensional array and sort from there.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.