1
votes

I have a GAEJ and would like to save images, uploaded from an Android device and iPhone.

Why is there two Google Services and wich one should be used from GAEJ?

Google Blobstore https://developers.google.com/appengine/docs/java/blobstore/

Google Cloud Storeage https://developers.google.com/storage/

Pseudo code:

  1. HttpClient some Base64 encoded data.
  2. Send image to Google App Engine.
  3. From Google App Engine Save the decoded image to BlobStore or Cloud Storage.
  4. HttpServletResponse status back to Android.

I am confused about how to do step 3.

Thanks in advance Regards

1

1 Answers

1
votes

Long time ago when app engine existed, google cloud storage doesn't exists yet so the way to store blobs is with blobstore. Now it existed they made the api for blobstore work with google cloud storage as well. Both work with image serving/manipulations. But cloud storage I think is also built in cdn which serves to closest edge server while blobstore when downloading will be coming from your appengine instance.

Uploading to either of this works the same way, from your client you need to request an upload url session where it will then be uploaded directly to blobstore/cloud storage when you post to that url

send_to_client_url = blobstore.create_upload_url('/yourHandler')
HttpClient.post file to send_to_client_url
yourHandler recieves a blob row then store blobKey to your datastore as reference

you will already have uploaded the file when it reaches yourhandler/or failed so handle appropriately on what you respond back to client(android/ios)