I'm using App Engine with Python. In order to store the images of my
users, I write them directly to the blobstore as indicated in Google
documentation.

My code is below:

# Image insertion in the blobstore
file_name = files.blobstore.create(mime_type='image/jpeg')
with files.open(file_name, 'a') as f:
    f.write(self.imageContent)
files.finalize(file_name)
self.blobKey = files.blobstore.get_blob_key(file_name)
logging.info("Blobkey: "+str(self.blobKey))

The problem is erratic. I don't change anything and since yesterday
sometimes it works sometimes it doesn't work. Why? As I print the
blobkey (last line of my code), I can see whether the image has been
saved into the blobstore or not.

When it works, I have the following line displayed:
Blobkey: AMIfv94p1cFdqkZa3AhZUF2Tf76szVEwpGgwOpN...

When it doesn't work, I have this in my logs:
Blobkey: None

Last detail: images (self.imageContent) are preprocessed and converted
into .JPEG before each write.

I would like to know what should I do in such a situation? Am I doing
something wrong that makes App Engine behavior erratic. How can I
solve this out?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to