Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine 在Google App Engine中从Google云存储服务大文件_Google App Engine_Dart_Google Cloud Storage - Fatal编程技术网

Google app engine 在Google App Engine中从Google云存储服务大文件

Google app engine 在Google App Engine中从Google云存储服务大文件,google-app-engine,dart,google-cloud-storage,Google App Engine,Dart,Google Cloud Storage,在AppEngine灵活的环境中运行dart服务器,似乎存在提供大于的文件的限制 我想提供的文件有几个要求: 文件大小可以大于32MB 无法公开访问(授权在服务器上完成) 此时,我尝试使用库从bucket读取文件,然后通过管道进入request.response。由于限制,此操作失败,例如:HTTP响应太大:33554744。限制为:33554432。 有没有一种方法可以从存储中为较大的文件提供服务?关于这个主题的文档非常混乱(我认为根本没有dart特定的文档)。我一直在阅读有关的内容,但我

在AppEngine灵活的环境中运行dart服务器,似乎存在提供大于的文件的限制

我想提供的文件有几个要求:

  • 文件大小可以大于32MB
  • 无法公开访问(授权在服务器上完成)
此时,我尝试使用库从bucket读取文件,然后通过管道进入
request.response
。由于限制,此操作失败,例如:
HTTP响应太大:33554744。限制为:33554432。


有没有一种方法可以从存储中为较大的文件提供服务?关于这个主题的文档非常混乱(我认为根本没有dart特定的文档)。我一直在阅读有关的内容,但我不确定此解决方案是否适用于dart。

正如@filiph所建议的,您可以从Google云存储中使用

服务器端我有以下python代码:

import time
import base64

from oauth2client.service_account import ServiceAccountCredentials


def create_signed_url(file_location):
    # Get credentials
    creds = ServiceAccountCredentials.from_json_keyfile_name('filename_of_private_key.json')
    client_id = creds.service_account_email

    # Set time limit to two hours from now
    timestamp = time.time() + 2 * 3600

    # Generate signature string
    signature_string = "GET\n\n\n%d\n%s" % (timestamp, file_location)
    signature = creds.sign_blob(signature_string)[1]
    encoded_signature = base64.b64encode(signature)
    encoded_signature = encoded_signature.replace("+", "%2B").replace("/", "%2F")

    # Generate url
    return "https://storage.googleapis.com%s?GoogleAccessId=%s&Expires=%d&&Signature=%s" % (
    file_location, client_id, timestamp, encoded_signature)

FWIW,我不认为这是特定于飞镖的。32MB大小限制适用于所有应用程序引擎FE。BlobStore是一种选择,但它看起来像是云存储继承了它(注1)。你是不是在找像“但在飞镖”这样的东西?和这里有关吗?如果是这样的话,在gcloud lib API中使用它会对您有所帮助吗?@filiph如果我可以直接从Dart gcloud API中使用它,那将非常方便。目前,我使用自己的实现,使用
googleapis\u auth/src/crypto/pem.dart
googleapis\u auth/src/crypto/rsa\u sign.dart
@filiph,我们在gcloud存储库中为此创建了一个