• <bdo id='yTjWR'></bdo><ul id='yTjWR'></ul>

    <i id='yTjWR'><tr id='yTjWR'><dt id='yTjWR'><q id='yTjWR'><span id='yTjWR'><b id='yTjWR'><form id='yTjWR'><ins id='yTjWR'></ins><ul id='yTjWR'></ul><sub id='yTjWR'></sub></form><legend id='yTjWR'></legend><bdo id='yTjWR'><pre id='yTjWR'><center id='yTjWR'></center></pre></bdo></b><th id='yTjWR'></th></span></q></dt></tr></i><div id='yTjWR'><tfoot id='yTjWR'></tfoot><dl id='yTjWR'><fieldset id='yTjWR'></fieldset></dl></div>
    <tfoot id='yTjWR'></tfoot><legend id='yTjWR'><style id='yTjWR'><dir id='yTjWR'><q id='yTjWR'></q></dir></style></legend>
    1. <small id='yTjWR'></small><noframes id='yTjWR'>

      1. 使用 Google App Engine (Python) 将文件上传到 Google Cloud Storage

        Upload Files To Google Cloud Storage With Google App Engine (Python)(使用 Google App Engine (Python) 将文件上传到 Google Cloud Storage)

          <legend id='Xzgix'><style id='Xzgix'><dir id='Xzgix'><q id='Xzgix'></q></dir></style></legend>
            • <bdo id='Xzgix'></bdo><ul id='Xzgix'></ul>

              <small id='Xzgix'></small><noframes id='Xzgix'>

                <tbody id='Xzgix'></tbody>
              <tfoot id='Xzgix'></tfoot>
            • <i id='Xzgix'><tr id='Xzgix'><dt id='Xzgix'><q id='Xzgix'><span id='Xzgix'><b id='Xzgix'><form id='Xzgix'><ins id='Xzgix'></ins><ul id='Xzgix'></ul><sub id='Xzgix'></sub></form><legend id='Xzgix'></legend><bdo id='Xzgix'><pre id='Xzgix'><center id='Xzgix'></center></pre></bdo></b><th id='Xzgix'></th></span></q></dt></tr></i><div id='Xzgix'><tfoot id='Xzgix'></tfoot><dl id='Xzgix'><fieldset id='Xzgix'></fieldset></dl></div>

                • 本文介绍了使用 Google App Engine (Python) 将文件上传到 Google Cloud Storage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试建立一个基于 python 的基本谷歌应用引擎网站,允许用户将文件上传到谷歌云存储(主要是图片)

                  I'm trying to set up a basic python-based google app engine site that allows users to upload files to google cloud storage (mostly images)

                  我一直在阅读 JSON API 和 GCS 客户端库概述(以及 blobstore 等)的文档,但仍然没有很好地掌握哪种方法是最好的方法以及它们之间的关系.如果有人可以对此进行概述或指出我可以查看的一些资源,那就太好了

                  I've been going through the documentation for the JSON API and the GCS client library overview (as well as blobstore etc) and still don't have a good handle on which is the best method and how they are related. Would be great if someone could give an overview of this or point me to some resources I can check out

                  此外,任何相关的示例代码都会非常有帮助.我已经能够在此处运行上传示例,但不确定它们是否对应用引擎设置有用:https://github.com/GoogleCloudPlatform/storage-file-transfer-json-python

                  Also, any sample code that's relevant would be really helpful. I've been able to run the upload samples here but not sure if they're useful for an app engine setup: https://github.com/GoogleCloudPlatform/storage-file-transfer-json-python

                  谢谢!!

                  推荐答案

                  Google Cloud Storage 有两个 API——XML API 和 JSON API.XML API 是基于 XML 的,非常类似于 Amazon S3 API.JSON API 与许多其他 Google API 类似,它适用于标准的 Google API 客户端库(例如,Google API Python 库).这两种 API 都可以在任何地方使用,无论是否使用 App Engine,并且基于 RESTful HTTP 调用.

                  Google Cloud Storage has two APIs -- the XML API and the JSON API. The XML API is XML based and very like the Amazon S3 API. The JSON API is similar to many other Google APIs, and it works with the standard Google API client libraries (for example, the Google API Python library). Both of these APIs can be used from anywhere, with or without App Engine, and are based on RESTful HTTP calls.

                  App Engine 提供了几种访问 Google Cloud Storage 的标准方法.第一个是内置在 App Engine 的 API 中,称为 "Google Cloud Storage Python API".这不直接使用 XML 或 JSON API.它已被弃用,不再推荐.

                  App Engine provides a couple of standard ways to access Google Cloud Storage. The first is built into App Engine's API as a feature called the "Google Cloud Storage Python API". This does not directly use either the XML or the JSON API. It's deprecated and no longer recommended.

                  第二个 App Engine 库称为 "Google Cloud StoragePython Client Library" 并且不是核心 App Engine API 的一部分.相反,它是由 Google 推出的 Python 库,您可以像任何其他库一样下载并添加到您的应用程序中.这个库恰好是使用XML API.它提供了一些对 App Engine 用户有用的额外功能,例如在上传过程中序列化上传的能力.在 python/demo 中有一个使用这个库作为下载的一部分的示例目录.您可以也可以在线查看.

                  The second App Engine library is called the "Google Cloud Storage Python Client Library" and is not part of the core App Engine API. Instead, it's a Python library put out by Google that you can download and add to your application like any other library. This library happens to be implemented using the XML API. It provides a few extra features that are useful for App Engine users, such as the ability to serialize an upload while it's in progress. There's an example of using this library included as part of the download, in the python/demo directory. You can also see it online.

                  这些工具的等价物也存在于 Java 和 Go 中.

                  Equivalents of these tools also exist in Java and Go.

                  用户无需使用特定于 App Engine 的库,除非他们认为这些库有用.标准 Python 库,甚至只是使用 urlfetch 的手写 HTTP 调用都可以正常工作.App Engine 库只是为 App Engine 用户提供了一些有用的附加功能.

                  There's no need for users to use the App Engine-specific libraries unless they find them to be useful. The standard Python library or even just hand-written HTTP calls using urlfetch will work just as well. The App Engine library merely provides some useful extras for App Engine users.

                  App Engine 还有一个Blobstore Python API".这是 App Engine 特有的功能,与 Google Cloud Storage 不同,只是它提供了一些与 Google Cloud Storage 的挂钩,例如使用 Blobstore API 将文件存储在 Google Cloud Storage 中的能力.

                  App Engine also have a "Blobstore Python API". This is a feature specific to App Engine and distinct from Google Cloud Storage, except that it provides a few hooks into Google Cloud Storage, such as the ability to store files in Google Cloud Storage using the Blobstore API.

                  这篇关于使用 Google App Engine (Python) 将文件上传到 Google Cloud Storage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  What happens when you compare 2 pandas Series(当你比较 2 个 pandas 系列时会发生什么)
                  Quickly find differences between two large text files(快速查找两个大文本文件之间的差异)
                  Python - Compare 2 files and output differences(Python - 比较 2 个文件和输出差异)
                  Why do comparisions between very large float values fail in python?(为什么在 python 中非常大的浮点值之间的比较会失败?)
                  Dictionary merge by updating but not overwriting if value exists(字典通过更新合并,但如果值存在则不覆盖)
                  Find entries of one text file in another file in python(在python中的另一个文件中查找一个文本文件的条目)
                  <tfoot id='UhOT2'></tfoot>

                        <bdo id='UhOT2'></bdo><ul id='UhOT2'></ul>

                            <tbody id='UhOT2'></tbody>
                          <legend id='UhOT2'><style id='UhOT2'><dir id='UhOT2'><q id='UhOT2'></q></dir></style></legend>
                        • <small id='UhOT2'></small><noframes id='UhOT2'>

                        • <i id='UhOT2'><tr id='UhOT2'><dt id='UhOT2'><q id='UhOT2'><span id='UhOT2'><b id='UhOT2'><form id='UhOT2'><ins id='UhOT2'></ins><ul id='UhOT2'></ul><sub id='UhOT2'></sub></form><legend id='UhOT2'></legend><bdo id='UhOT2'><pre id='UhOT2'><center id='UhOT2'></center></pre></bdo></b><th id='UhOT2'></th></span></q></dt></tr></i><div id='UhOT2'><tfoot id='UhOT2'></tfoot><dl id='UhOT2'><fieldset id='UhOT2'></fieldset></dl></div>