获取 Google Cloud Storage 中的文件列表(Appengine PHP) [英] Get list of Files in Google Cloud Storage (Appengine PHP)

查看:40
本文介绍了获取 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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆