【问题标题】:I want to serve PDF files stored in Google Cloud Storage我想提供存储在 Google Cloud Storage 中的 PDF 文件
【发布时间】:2020-08-21 18:51:38
【问题描述】:

我需要提供存储在 Google Cloud Storage 中的 PDF 文件。 我试过了:

from google.appengine.api import blobstore
from google.appengine.api import images
bkey = blobstore.create_gs_key('/gs' + filename)
url = images.get_serving_url(bkey)

错误:

get_serving_url_hook\n raise _ToImagesError(e, readable_blob_key)\n', 'TransformationError\n']

【问题讨论】:

  • 您使用的是 App Engine python 2 吗?

标签: google-app-engine google-cloud-platform google-cloud-storage


【解决方案1】:

您将 PDF 文件视为图像。您不能将 'images' api 与 pdf 文件一起使用。有几种存储和提供静态文件的方法,您可以从此链接找到这些方法 [1]

[1]https://cloud.google.com/appengine/docs/standard/python3/serving-static-files

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-07
    • 2023-03-23
    • 2014-03-02
    • 2018-05-23
    • 1970-01-01
    • 2020-11-23
    相关资源
    最近更新 更多