- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有一个充满 BlobKey 的数据库,这些 BlobKey 是以前通过标准 Google App Engine 上传的 create_upload_url()过程,并且通过设置 gs_bucket_name
参数,每次上传都进入同一个 Google Cloud Storage 存储桶。
我想做的是能够解码现有的 blobkeys,这样我就可以获得他们的 Google Cloud Storage 文件名。我知道我可以一直在使用 gs_object_name来自 FileInfo class 的属性(property),除了:
You must save the gs_object_name yourself in your upload handler or this data will be lost. (The other metadata for the object in GCS is stored in GCS automatically, so you don't need to save that in your upload handler.
意思是 gs_object_name
属性仅在上传处理程序中可用,如果我当时没有保存它,那么它就会丢失。
此外,create_gs_key()没有成功,因为它取而代之的是使用谷歌存储文件名并创建一个 blobkey。
那么,我如何获取之前通过应用引擎上传到 Google Cloud Storage 存储桶的 blobkey,并获取它的 Google Cloud Storage 文件名? ( python )
最佳答案
您只能在上传处理程序 (fileInfo.gs_object_name) 中获取云存储文件名并将其存储在您的数据库中。之后它丢失了,似乎没有保存在 BlobInfo 或其他元数据结构中。
Google says: Unlike BlobInfo metadata FileInfo metadata is not persisted to datastore. (There is no blob key either, but you can create one later if needed by calling create_gs_key.) You must save the gs_object_name yourself in your upload handler or this data will be lost.
https://developers.google.com/appengine/docs/python/blobstore/fileinfoclass
更新:我能够在 Blobstore-Viewer 中解码 SDK-BlobKey:“encoded_gs_file:base64-encoded-filename-here”。然而,真实的东西不是 base64 编码的。
create_gs_key(filename, rpc=None) ... Google 说:“将加密的 blob key 作为字符串返回。”有谁猜到为什么这是加密的?
关于google-app-engine - 将 App Engine Blobkey 解码为 Google Cloud Storage 文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19130113/
我想知道保存 blobstore 引用的最佳方法是什么记录的方式是这样的: blobstore.BlobReferenceProperty() 或 ndb.BlobKeyProperty() 或 db
我已经实现了 appengine docs 中提到的通用 blob 服务处理程序。 .只要您知道该 blob 的 key 字符串,该处理程序就会为您提供任何 blob。我使用它来轻松编写客户端可以用来
我想为该用户上传到服务器的文件提供服务(编辑)。将其保存到 blobstore 后,我想将其加载到内存中进行编辑。存储文件后,我得到了 BlobKey 作为返回。据我了解,我应该使用以下方法将其加载到
您好,我正在尝试制作一个 servlet,允许管理员上传图像,并允许任何 google 用户查看这些图像,到目前为止,我正在使用 https://developers.google.com/appen
我从数据存储区获取 blobkey。 现在我想使用这个 blobkey 来获取 blobstore 中 blob 的内容类型。 怎么做? 最佳答案 您可以尝试此代码 BlobInfoFactory b
这是一个服务器端问题。我只有一个 BlobKey,没有其他东西。如何从所述 BlobKey 获取 blob 文件名?我知道如何获取servingUrl为 ServingUrlOptions optio
我编写了一个 Google App Engine 应用程序,它使用 Blobstore 来保存以编程方式生成的数据。为此,我使用了 Files API ,不幸的是,它已被弃用,取而代之的是 Googl
我正在从已弃用的文件 API 中转换代码。 我有以下代码在 SDK 服务器中运行良好但在生产环境中失败。我在做什么是正确的吗?如果是,可能出了什么问题,有什么解决方法吗? # Code earlier
我正在尝试在 GoogleAppEngine 上保存并提供一个 blob。 // Save the data as a blob final FileService fileService = Fil
我有一个从给定网址获取图像并将其保存到 Google Cloud Storage 并检索服务网址的过程。现在,我的理解(根据我读过的文档)是我还必须在引用 GCS 文件的过程中创建一个 blob。如果
我正在运行本地开发服务器并使用 image.ServingURL 从存储在 Google 存储中的 BlobKey 创建一个 url。这个 url 应该返回开发服务器上的图像吗? 我收到这样的错误:C
这里发生了奇怪的事情。运行任何调用的单元测试时: FileService fileService = FileServiceFactory.getFileService(); writeChannel
因此,由于新的高性能图片服务,我决定重写我的图片库。这意味着使用我以前从未使用过的 Blobstore。在我尝试将 BlobKey 存储在我的模型中之前,它看起来很简单。 到底如何在模型中存储对 bl
我有一个充满 BlobKey 的数据库,这些 BlobKey 是以前通过标准 Google App Engine 上传的 create_upload_url()过程,并且通过设置 gs_bucket_
在我的 Android 应用程序中,我想将图像上传到 Blobstore,然后检索上传 url 和图像的 Blobkey,这样我就可以将 Blobkey 存储在 DataStore 中。 我试过这段代
我是一名优秀的程序员,十分优秀!