Performing the upload itself is done by the user, not your application. Your app returns a URL that gets inserted into a form, a user selects a file, and it is uploaded to the blobstore. Only after the file is already in the blobstore is your application called again with the resulting blob key. create_upload_url() and get_uploads() should be called in separate handlers.
On Mon, Feb 6, 2012 at 3:52 PM, thstart <[email protected]> wrote: > I want to create an app which to perform upload of a CSV file to the > cloud. Right now > I am using upload_url = blobstore.create_upload_url('/upload') and get_uploads > which are a synchronous. > Sometimes the app is getting an *error *or *timeout*. > > I suppose timeout can be solved with asynchronous requests, but not the > errors. For errors probably the best solution > is to generate another upload_url and automatically repeat the process, > but it will reach the 30-60 secs limit. > > Reading the documentation about the new Blobstore Asynchronous Requests I > mention it is asynchronous during > generating upload URL. I don't think generating upload URL is slow. I > would rather prefer the upload operation > itself to by asynchronous and with s call back my app the get the results. > > How to accomplish that? > > > http://code.google.com/appengine/docs/python/blobstore/overview.html#Making_Asynchronous_Requests > > > upload_url*_rpc* = blobstore.create_upload_url*_async*('/upload') > slow_operation() > *upload_url = upload_url_rpc.get_result()* > self.response.out.write("""<form action="%s" method="POST" > enctype="multipart/form-data">""" % upload_url) > > In this example, the application carries out the slow_operation() code at > the same time that Blobstore generates the upload URL. > > > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/google-appengine/-/UUVgGyapiPkJ. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
