Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Uploading an image from android to google app engine?

$
0
0

I'm trying to take a photo on an android app, and then send it to my google app engine app.

I have the taking a photo part done, however I'm struggling with the rest.

This is what I'm using the send the image:

// send to AppEngine
                // the view you want to create as an image
                var saveImageView = Titanium.UI.createImageView({
                    top : 0,
                    left : 0,
                    width : 'auto',
                    height : 'auto',
                    image : event.media,
                });
 
                win1.add(saveImageView);
                imageToUpload = saveImageView.toBlob();
                // toBlob, not toImage!! important...
                var xhr = Titanium.Network.createHTTPClient();
                xhr.onload = function() {
                    win1.remove(saveImageView);
                    // remove the temp view...
                };
                xhr.open('POST', '???');
                xhr.send({
                    image : imageToUpload
                });
                /////////////////////
However, I'm not sure what to pass as the second argument to xhr.open().

I know it's got to be the address to my GAE app's server (at least I think), but I'm not sure how to find this address, nor how to setup my GAE app to make uploading the image possible like this.

Any help would be greatly appreciated.


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>