问题描述
我有一个Google Cloud Storage存储桶"MyBucket",它有20个项目.我想在我的appengine PHP应用程序中获得这些文件名.
I have a Google Cloud Storage bucket "MyBucket" and it have 20 items. I would like to get those file name in my appengine PHP application.
我正在寻找是否可以使用App Engine的内置Google Cloud Storage(GCS)流包装器获取列表.
I'm Looking whether we can get the list using App Engine's built-in Google Cloud Storage (GCS) stream wrapper.
类似这样的东西:
require_once 'google/appengine/api/cloud_storage/CloudStorageTools.php';
use google\appengine\api\cloud_storage\CloudStorageTools;
$bucket_name = 'gs://my-bucket/';
$file_list = CloudStorageTools::list($bucket_name); //Won't Work. Function like this
推荐答案
基于参考.CloudStorateTools的文档没有列出文件之类的东西.考虑使用其他API(例如JSON API)访问Google Cloud Storage.对于列表功能,您可以检查此链接
based onref. documentation for CloudStorateTools there is no such thing like listing files. Consider to use different API for accessing Google Cloud Storage like JSON API. For list function you can check this link.
这篇关于获取Google Cloud Storage中的文件列表(Appengine PHP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!