[google-appengine] Re: Uploading to the blobstore directly

2010-09-07 Thread Shay Erlichmen
I spend several hours searching for something like your code and could
find any.
This code is kinda what I wrote myself (Yours is better).

The thing is I that really think that there should be a static/fixed
endpoint for uploads.

The flow should be something like:
1. You upload/post to a fixed (configurable) url i.e. /upload/?
param1=val¶m2=val
2. That url is not limited to the 1MB and it will store the content in
the blobstore
3. You will define using regex which dispatcher/controller will
receive the upload results
4. This dispatcher/controller will be called using a forward redirect
and not an actual redirect
5. The dispatcher/controller will return a response which doesn't have
to be a redirect

--- 10 minutes pause ---
OK, I open an issue for it 
http://code.google.com/p/googleappengine/issues/detail?id=3686

On Sep 6, 10:21 pm, John McLaughlin 
wrote:
> I think you've got the picture.  I was dealing with this sort of thing
> a couple weeks ago and wrote a cookbook page that kinda-sorta makes it
> a one step 
> process.http://appengine-cookbook.appspot.com/recipe/just-in-time-blobstore-u...
>
> Let me know if it's helpful.
>
> -- John
>
> On Sep 5, 11:03 am, Shay Erlichmen  wrote:
>
>
>
>
>
>
>
> > I have an OCR service* that allows you to upload pictures and get the
> > text.
> > The service has a very simple REST API (/post_image) where you POST
> > the image (and some metadata) and you get the result in JSON format.
> > The service is called from Flash, Web, and other clients.
>
> > So far I've used blobs in the datastore to store and serve the images
> > and I want to move to the blobstore (in order to use get_serving_url)
> > As far as I can see, I need to break my /post_image method into two
> > steps: the first step will be to call a new method /prepare_upload
> > which will get me the upload url (by calling create_upload_url(...)),
> > then call the returned upload_url and get the JSON data.
> > To make things more awkward, the result from the upload url cannot be
> > the JSON data itself but a redirect to a url that returns the JSON
> > data.
>
> > Questions:
> > 1. Did I analyze it right? Is is a two stepper flow for my clients?
> > are there any unnecessary steps??.
> > 2. In case I got it correct, are there any plans for direct upload to
> > the blobstore (without calling create_upload_url(...))
>
> > * service for illustration purpose only, I don't really have this
> > exact service.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: Uploading to the blobstore directly

2010-09-07 Thread Shay Erlichmen
Your steps seem logical but,
Problem is that the some clients are necessary in the browser, so
there is no form to submit.
Those clients needs a "fixed" end point to upload the data (or call a
"fixed" end point that will return the upload url"

On Sep 7, 6:29 pm, timwhunt  wrote:
> I think I have this right, so hopefully to clarify:
>
> 1) You get the upload URL for an HTML form for your user to upload the
> image.  Part of forming that uploading URL is to identify the handler
> code (e.g., Servlet in Java)
> 2) Your handler code gets called by the Blobstore after the upload is
> complete and that handler can work with the uploaded data and you'll
> work with the the key for the blob
> 3) Your handler sends a redirect command back to the user's browser
> directing them to the page they need to go to for status/results.
> That redirect URL generally includes a parameter identifying which
> blob upload (it's key) you're dealing with.
> 4) The user's browser is redirected to that page, where your code uses
> the blobstore key (from the URL parameter) to process and in your case
> return the OCR data.
>
> So from the client point of view, they submit a forum with a file
> upload part, and they get redirected to the page that provides the
> results.
>
> Someone please correct if necessary.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: Uploading to the blobstore directly

2010-09-07 Thread timwhunt
I think I have this right, so hopefully to clarify:

1) You get the upload URL for an HTML form for your user to upload the
image.  Part of forming that uploading URL is to identify the handler
code (e.g., Servlet in Java)
2) Your handler code gets called by the Blobstore after the upload is
complete and that handler can work with the uploaded data and you'll
work with the the key for the blob
3) Your handler sends a redirect command back to the user's browser
directing them to the page they need to go to for status/results.
That redirect URL generally includes a parameter identifying which
blob upload (it's key) you're dealing with.
4) The user's browser is redirected to that page, where your code uses
the blobstore key (from the URL parameter) to process and in your case
return the OCR data.

So from the client point of view, they submit a forum with a file
upload part, and they get redirected to the page that provides the
results.

Someone please correct if necessary.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: Uploading to the blobstore directly

2010-09-06 Thread John McLaughlin
I think you've got the picture.  I was dealing with this sort of thing
a couple weeks ago and wrote a cookbook page that kinda-sorta makes it
a one step process.
http://appengine-cookbook.appspot.com/recipe/just-in-time-blobstore-upload-urls

Let me know if it's helpful.

-- John

On Sep 5, 11:03 am, Shay Erlichmen  wrote:
> I have an OCR service* that allows you to upload pictures and get the
> text.
> The service has a very simple REST API (/post_image) where you POST
> the image (and some metadata) and you get the result in JSON format.
> The service is called from Flash, Web, and other clients.
>
> So far I've used blobs in the datastore to store and serve the images
> and I want to move to the blobstore (in order to use get_serving_url)
> As far as I can see, I need to break my /post_image method into two
> steps: the first step will be to call a new method /prepare_upload
> which will get me the upload url (by calling create_upload_url(...)),
> then call the returned upload_url and get the JSON data.
> To make things more awkward, the result from the upload url cannot be
> the JSON data itself but a redirect to a url that returns the JSON
> data.
>
> Questions:
> 1. Did I analyze it right? Is is a two stepper flow for my clients?
> are there any unnecessary steps??.
> 2. In case I got it correct, are there any plans for direct upload to
> the blobstore (without calling create_upload_url(...))
>
> * service for illustration purpose only, I don't really have this
> exact service.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.