Search code examples
google-app-enginefile-uploadimage-uploadinggoogle-cloud-storagejquery-file-upload

Multiple upload requests to the same GCS/blobstore URL


I'm building a GAE photo app that allows uploading of multiple photos at once to the server. I am uploading to GCS, and also using a jquery library (https://github.com/blueimp/jQuery-File-Upload)(singleFileUploads: true)

The problem is I need to separate the upload into individual requests to the server (15 photos means 15 individual /_ah/upload/ requests). Currently, it is only 1 request for all photos. The user must be able to select 15 photos to submit all at once. However, it seems that the URL provided by GAE/GCS from the blobstoreService.createUploadUrl() method only accepts the first request and rejects the rest. Is it ever possible to send multiple upload requests to the same upload URL?

The reason for me wanting to split up the requests is because a problem with GCS. the getServingUrl method for photos takes extremely long to retrieve on the first request (2-5 seconds), and with 15 photos waiting, I could easily exceed the GAE's harddeadline exception of 60 seconds.

Any help will be greatly appreciated.


Solution

  • You can send more than one upload to a URL, however the URL is only valid for 10 minutes after it's created.

    The development server limits you to only one upload sent to the URL, but this limitation does not apply to production.