python - 如何在 google appengine、python 中调用请求处理程序

标签 python google-app-engine blobstore

我尝试分两步从表单加载文件,并使用 BlobStoreUploadHandler。 第一步,我使用请求处理程序接收表单数据,并检查其是否有效(表单操作=“/a”)。然后如果表单有效,我想将表单操作重写为 upload_url,其中

upload_url = blobstore.create_upload_url('/a') 

并使用新的path_info调用post请求。如何使用更改的 path_info 调用请求?

class SendFormwithFile(webapp.RequestHandler):
    ...
    def post(self):
        ... 
        if form.is_valid():
            self.request.path_info = upload_url

        else:
            ...
            return form with error message
            ...

最佳答案

有一个新的实验代码writing files到可能适合您需求的 blobstore。引用:

App Engine allows you to programmatically create blobstore blobs, providing a file-like API that you can use to read and write to blobs

关于python - 如何在 google appengine、python 中调用请求处理程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8204270/

相关文章:

java - Appengine blobstore 作为文件系统的限制和问题

python - 使用 --oauth_refresh_token 更新时 appcfg.py 返回未经授权的客户端

python - pytest - 在单独的进程中运行每个测试

google-app-engine - Google App Engine 上的身份验证(网页)

python - 任务队列/延迟中的 blobstore

java - 在 Android 应用程序中使用 Google BlobStore

python - 通过存储具有重复键的多个值,从 2 个列表创建字典

python - 如何将多个参数传递给 apply 函数

python - 在 Python 中显示 Blob 图像 (App Engine)

android - 在 Android 中上传到 App Engine Blob 存储