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.
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.
I don't think you can use a single upload URL more than once. But a workaround could be to write a small method that generates a new upload URL on demand, and some JS that calls it for each photo, then posts to that new URL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With