I use
  blobstore.create_upload_url()
as a form action url to upload files to cloud storage and getting blob_key by
  if self.request.get('file'):
    file_info = blobstore.parse_file_info(self.request.POST['file'])
    blob_key = 
blobstore.BlobKey(blobstore.create_gs_key(file_info.gs_object_name))
    ...
.

It was OK even if we don't choose a file for the file input, however
recently (maybe since 2014-05-13 JST) we'v been getting a unicode
string with
  self.request.POST['file']
instead of a cgi.FieldStorage object (this causes an error in
blobstore.parse_file_info()) and 0 byte files are created in the cloud
storage bucket.

I can avoid the error in blobstore.parse_file_info() like this:

  if self.request.get('file'):
    value = self.request.POST['file']
    if type(value) != unicode and type(value) != str:
      file_info = blobstore.parse_file_info(self.request.POST['file'])
      blob_key =
blobstore.BlobKey(blobstore.create_gs_key(file_info.gs_object_name))

However, I don't like having 0 bytes files in cloud storage for every
non-file attached POSTs.
Am I doing something wrong?

---
Hiroshi Saito

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.

Reply via email to