[英]Store Images in datastore from local drive in Google App Engine
I couldn't find articles match to my requirements.我找不到符合我要求的文章。
Basically, what I want is that:基本上,我想要的是:
Any suggestions?有什么建议么? Urgent.紧迫的。
That's exactly what is discussed in the documentation for the BlobStore API .这正是BlobStore API 文档中讨论的内容。
You can do this in much the same way as you would in any other framework or platform: Create an HTML form with a 'file' input and the mimetype set to 'multipart/form-data'.您可以像在任何其他框架或平台中一样以几乎相同的方式执行此操作:创建一个 HTML 表单,其中包含“文件”输入并将 mimetype 设置为“multipart/form-data”。 On the server side, extract the file data from the form field (using self.request.POST['fieldname'].value
in webapp) and store the contents in a datastore model, in a db.BlobProperty
field.在服务器端,从表单字段中提取文件数据(在 webapp 中使用self.request.POST['fieldname'].value
)并将内容存储在数据存储区 model 的db.BlobProperty
字段中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.