I am trying to upload and save a modified image in the db.BlobProperty field in Google App Engine using Django.
the relevant part of my view that the request process is as follows:
image = images.resize(request.POST.get('image'), 100, 100)
recipe.large_image = db.Blob(image)
recipe.put()
This seems to be the logical equivalent of the django example in the docs:
from google.appengine.api import images
class Guestbook(webapp.RequestHandler):
def post(self):
greeting = Greeting()
if users.get_current_user():
greeting.author = users.get_current_user()
greeting.content = self.request.get("content")
avatar = images.resize(self.request.get("img"), 32, 32)
greeting.avatar = db.Blob(avatar)
greeting.put()
self.redirect('/')
(source: http://code.google.com/appengine/docs/python/images/usingimages.html#Transform )
But I keep getting the error message: NotImageError / Empty image.
and refers to this line:
image = images.resize(request.POST.get('image'), 100, 100)
. , , , . enctype = "multipart/form-data" . , - , . "request.POST.get('image')", , . ?
.