java - Must be called from a blob upload callback request -


i have implemented gwt example blobstore api in java: https://cloud.google.com/appengine/docs/java/blobstore/

it works fine when post made via client side form (inside browser).

however, sending files (images) same /upload service handler python request inside offline program (not browser):

r = requests.post(url+'upload', files= {'myfile': open('fig.jpeg', 'rb')}) 

and following exception

must called blob upload callback request

in first line of (server side):

map<string, list<blobkey>> blobs = blobstoreservice.getuploads(req); list<blobkey> blobkeys = blobs.get("myfile"); 

what doing wrong??

that /upload handler not meant call directly, neither browser nor python application. instead, application need make 2 calls: first server temporary url, second upload url, connect blobstore directly. server should generate temporary url using blobstoreservice.createuploadurl, described in step 1 of this section of documentation linked.

during course of second call (the upload), blobstore directly call upload handler inform app new blob(s). blobstoreservice.getuploads(req) knows how interpret.

so python application make 2 calls, , server handle 2 requests. first request comes directly python application requesting url. second request happen during upload, come directly blobstore.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -