【问题标题】:How to fetch the data from the google cloud storage?如何从谷歌云存储中获取数据?
【发布时间】:2018-08-09 07:58:04
【问题描述】:

我正在创建 Dialogflow 应用程序,我想在某个流程点发送 SMS。为此,我正在考虑将收件人的电话号码存储在 excel 中,并将此 excel 放在 google cloud storage 中。如何从该 excel 中获取电话数据?

【问题讨论】:

  • 这似乎效率不高。为什么不使用可以轻松查询的数据库?
  • 不,我的要求是从客户端获取的excel中获取数据。我可以使用谷歌电子表格吗?如果是这样,请告诉我怎么做?

标签: google-cloud-storage google-cloud-functions


【解决方案1】:

您可以将文件放在您提到的 Google 云存储 (GCS) 中,并使用例如用于 GCS 的 PHP 客户端库 [1] 以及 PHPExcel [2]。

您会发现使用 PHP 从 Excel 文件中读取和提取数据非常容易。

您还可以使用 PHP-ExcelReader [3],它也可以读取 Excel .xls 文件。 PHPExcel 还可以管理 .xlsx 文件。

我发现本教程 [4] 有助于说明如何使用 PHPExcel 读取 Excel 文件。

您可以从(例如)Compute Engine [5]、App Engine [6] 运行您的 PHP 应用程序。请查看此参考资料 [7],它说明了如何在 Google Cloud Platform 上部署 PHP 应用程序。

我还想推荐这个 Bucket and Object Naming Guidelines 参考 [8]。请访问本教程 [9] 了解如何创建存储桶和上传对象。

不要忘记查看 GCS 身份验证 [10],以便您能够获得和管理对服务的访问权限。

告诉我进展如何。


链接:

[1]https://cloud.google.com/storage/docs/reference/libraries#client-libraries-install-php

[2]https://github.com/PHPOffice/PHPExcel

[3]https://sourceforge.net/projects/phpexcelreader

[4]http://www.techchattr.com/how-to-read-excel-files-with-php

[5]https://cloud.google.com/php/tutorials/bookshelf-on-compute-engine

[6]https://cloud.google.com/appengine/docs/php/

[7]https://cloud.google.com/php/docs/

[8]https://cloud.google.com/storage/docs/naming#top_of_page

[9]https://cloud.google.com/storage/docs/quickstart-gsutil

[10]https://cloud.google.com/storage/docs/authentication

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-11
    • 1970-01-01
    • 2015-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多