Uploading multiple files to blobstore (redux)
Asked Answered
B

2

7

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?

Bluebonnet answered 5/2, 2011 at 13:36 Comment(1)
Why on earth are there so many tags based on uploading files?Bluebonnet
C
9

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.

Chanukah answered 6/2, 2011 at 23:32 Comment(2)
Cool... the docs are very misleading in that respect. BTW, the new plugin at aquantum-demo.appspot.com/file-upload uses a callback to start uploading, so there's no need to make a sync call that blocks the browser at all... A lot of people are looking to your post for authoritative info, so you might want to mention it.Bluebonnet
@Nick, I am able to upload multiple files in one post using Nick R's suggestion. Is your answer outdated?Acnode
T
3

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.

Thisbee answered 5/2, 2011 at 20:46 Comment(1)
so I guess for blob_info in self.get_uploads() would also workShulamite

© 2022 - 2024 — McMap. All rights reserved.