views:

815

answers:

2

I have a model which *I want* to contain an image blob. I have the images on my local filesystem, but due to the nature of my application, I need to get them in the datastore. Here's my model:

class JeanImage(db.Model):
    type = db.StringProperty(required=True, choices=set(["main","front","back","detail"]))
    image = db.BlobProperty(required=True)

I haven't tried anything yet because I'm not great when dealing with images.

How can/should I convert my images to blobs so that I can get them in my bulkupload csv file?

Mark

A: 

I believe that what you are trying to achieve is not possible using the app engine bulkloader.

Instead try to create some kind of uploader yourself. For example you could upload the images as a zip file and then extract it an store it in the datastore. The code for that should be fairly straightforward if you can map your images to the datastore entity (e.g. by using a naming convention).

Benedikt Eger
+1  A: 

You can do it, just not with the bulk uploader. You need to access the remote api directly.

This site has a basic example of how to use it: http://www.billkatz.com/2009/2/Remote-API-Hello-World

Its pretty slow and a good idea to have a retry mechanism.

A more detailed description can be found here: http://code.google.com/appengine/articles/remote_api.html

Sam