Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploading multiple files to blobstore (redux)

Yes, I've seen this question already, but I'm finding information that contradicts its accepted answer and Nick Johnson's blog on the GAE docs.

The docs talk about uploading more than one file at the same time - the function to get uploaded files returns a list:

The get_uploads() method returns a list of BlobInfo objects, one for each uploaded file in the request.

But everywhere I've looked, the going assumption is that only one file a time can be uploaded, and a new upload url needs to be created each time.

Is it even possible to upload more than one file at the same time using HTML5/Flash using Plupload?

like image 569
Sudhir Jonathan Avatar asked Feb 05 '11 13:02

Sudhir Jonathan


2 Answers

Currently, the blobstore service upload URLs only support one file upload per post. In order to upload multiple files, you need to use the pattern documented in my blog posts. In future, we may extend the blobstore API to support more flexible upload URLs, supporting multiple uploaded files in a single request.

Edit: The blobstore now supports multiple file uploads in a single request.

like image 143
Nick Johnson Avatar answered Nov 03 '22 06:11

Nick Johnson


Here's how I use the get_uploads() method for more than one file:

blob_info = self.get_uploads()[0]
blob_info2 = self.get_uploads()[1]

Nick Johnson's dropbox service is another example and I hope you find what suits your needs.

like image 38
Niklas Rosencrantz Avatar answered Nov 03 '22 07:11

Niklas Rosencrantz