这是我从flex 4文件引用上传得到的:
在自我请求=
Request: POST /UPLOAD
Accept: text/*
Cache-Control: no-cache
Connection: Keep-Alive
Content-Length: 51386
Content-Type: multipart/form-data; boundary=----------ei4cH2gL6ae0ei4ae0gL6GI3KM7ei4
Host: localhost:8080
User-Agent: Shockwave Flash
------------ei4cH2gL6ae0ei4ae0gL6GI3KM7ei4
Content-Disposition: form-data; name="Filename"
36823_117825034935819_100001249682611_118718_676534_n.jpg
------------ei4cH2gL6ae0ei4ae0gL6GI3KM7ei4
Content-Disposition: form-data; name="Filedata"; filename="36823_117825034935819_100001249682611_118718_676534_n.jpg"
Content-Type: application/octet-stream
���� [AND OTHER STRANGE CHARACTERS]
我的班级:
^{pr2}$为了把文件保存到磁盘上,我在Upload类中缺少了什么? 我在contentvar中有一些奇怪的字符(在调试中查看)。在
您需要做的是向用户呈现带有文件上载字段的表单。
当表单提交时,文件被上传,Blobstore从文件内容创建一个blob,并返回一个blob键,用于以后检索和服务blob。
允许的最大对象大小为2GB。在
下面是一个可以按原样尝试的工作片段:
编辑1:
^{pr2}$在您的特定情况下,您可以使用BlobProperty(限制为1MB)来存储您的请求:
然后调整您的
webapp.RequestHandler
以保存您的请求:编辑2:
你不需要改变应用程序yaml,只需添加一个新的处理程序并将其映射到您的WSGI中。 要检索存储的照片,您应该添加另一个处理程序来处理您的照片:
然后映射新的DownloadImage类:
您可以使用url获取图像:
根据要求,如果出于任何奇怪的原因,您确实希望使用这种url
www.mysite.com/i/photo_key.jpg
来提供图像,您可以尝试使用以下方法:使用稍微不同的映射:
相关问题 更多 >
编程相关推荐