开发者

In appengine how would i move my db.Blob's into the Blobstore

I have a bunch of images which I have stored in db.Blob's and am serving. I'd like to take开发者_开发技巧 advantage of the high availability BlobStore recently announced. How would I go about moving my blob's to the Blobstore.

The docs seem to indicate the only way to add to the Blobstore is via a file upload form.


The simplest idea is to create a migration task which sends images as multipart data to your request handler storing data into Blobstore.

For creating migration task see http://code.google.com/p/appengine-mapreduce/

Since sockets are disabled, the only way to send multipart data is through the URLFetch api (http://code.google.com/appengine/docs/python/urlfetch/)

Sending multipart data can be done with the following snippet: http://code.activestate.com/recipes/146306-http-client-to-post-using-multipartform-data/


I'd actually advise to wait a little while. Programmatic creation of blobs is on the roadmap, and should be coming up soon. If it's urgent though, then Piotr's solution sounds great.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜