How can I set the "blob-key" in BlobStore?

I tried to use the jquery "uploadify" plugin to upload multiple files to "My App" in Google App Engine and then save them using blobstore, but it failed. I traced the code in get_uploads, it seems to be field.type_options

empty and of course doesn't have a "blob-key". Where does the "blob-key" come from?

code like this:

def upload(request):
   for blob in blogstorehelper.get_uploads(request, 'Filedata'):
       file = File()
       file.blobref = blob
       file.save()
   return ……

      

but blogstorehelper.get_uploads (request, 'Filedata') is always empty. In fact, the request contains the uploaded file (I am typing the request). I debugged in blogstorehelper.get_uploads and found that field.type_options is empty. who can tell me why? Thank! that is the source of get_uploads: http://appengine-cookbook.appspot.com/recipe/blobstore-get_uploads-helper-function-for-django-request/?id=ahJhcHBlbmdpbmUtY29va2Jvb2tyjwELEgtSZWNpcGVJbmRleCI4YWhKaGNIQmxibWRwYm1VdFkyOXZhMkp2YjJ0eUZBc1NDRU5oZEdWbmIzSjVJZ1pFYW1GdVoyOE0MCxIGUmVjaXBlIjphaEpoY0hCbGJtZHBibVV0WTI5dmEySnZiMnR5RkFzU0NFTmhkR1ZuYjNKNUlnWkVhbUZ1WjI4TTIxDA

+2


source to share





All Articles