是否可以使用Google App Engine(不使用Google Compute Engine)通过API调用(使用Python)将文件下载到Google云存储

是否可以使用Google App Engine(不使用Google Compute Engine)通过API调用(使用Python)将文件下载到Google云存储,python,google-app-engine,google-cloud-storage,google-compute-engine,Python,Google App Engine,Google Cloud Storage,Google Compute Engine,我在这里编写了一个python程序,它连接了各种平台的API,用于文件下载。该程序目前在我的本地计算机(笔记本电脑)上运行,没有问题(当然,所有下载的文件都保存到我的本地驱动器) 这里是我真正的问题,没有谷歌计算引擎,是否有可能使用谷歌应用引擎部署相同的python程序?如果是,我如何将文件(通过API调用)保存到谷歌云存储 谢谢。这是一个Web应用程序吗?如果是这样,您可以使用谷歌应用程序引擎或 要将文件发送到云存储,请尝试repo(文件夹appengine/flexible/Storage/

我在这里编写了一个python程序,它连接了各种平台的API,用于文件下载。该程序目前在我的本地计算机(笔记本电脑)上运行,没有问题(当然,所有下载的文件都保存到我的本地驱动器)

这里是我真正的问题,没有谷歌计算引擎,是否有可能使用谷歌应用引擎部署相同的python程序?如果是,我如何将文件(通过API调用)保存到谷歌云存储


谢谢。

这是一个Web应用程序吗?如果是这样,您可以使用谷歌应用程序引擎或

要将文件发送到云存储,请尝试repo(文件夹
appengine/flexible/Storage/
)中的示例:

# [START upload]
@app.route('/upload', methods=['POST'])
def upload():
    """Process the uploaded file and upload it to Google Cloud Storage."""
    uploaded_file = request.files.get('file')

    if not uploaded_file:
        return 'No file uploaded.', 400

    # Create a Cloud Storage client.
    gcs = storage.Client()

    # Get the bucket that the file will be uploaded to.
    bucket = gcs.get_bucket(CLOUD_STORAGE_BUCKET)

    # Create a new blob and upload the file's content.
    blob = bucket.blob(uploaded_file.filename)

    blob.upload_from_string(
        uploaded_file.read(),
        content_type=uploaded_file.content_type
    )

    # The public URL can be used to directly access the uploaded file via HTTP.
    return blob.public_url
# [END upload]