Get list of Files in Google Cloud Storage (Appengine PHP)(获取 Google Cloud Storage 中的文件列表(Appengine PHP))
问题描述
我有一个 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 googleappengineapicloud_storageCloudStorageTools;
$bucket_name = 'gs://my-bucket/';
$file_list = CloudStorageTools::list($bucket_name); //Won't Work. Function like this
推荐答案
基于参考.CloudStorateTools 的文档 没有像列出文件这样的东西.考虑使用不同的 API 来访问 Google Cloud Storage,例如 JSON API.对于列表功能,您可以查看此 链接.
based on ref. 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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:获取 Google Cloud Storage 中的文件列表(Appengine PHP)


- 如何定位 php.ini 文件 (xampp) 2022-01-01
- Laravel 仓库 2022-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01