Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

XHR onsendstream Not Doing Anything on Android

I'm following the xhr_fileupload example from the KitchenSink (see code here) and it seems that onsendstream doesn't fire at all on Android. I haven't tested on iOS, yet. Right now just trying to lock down Android.

I searched through the forums and didn't see anyone else having this issue. Can anyone tell me what I'm doing wrong?

Here's my code, exactly.

var xhr = Titanium.Network.createHTTPClient();
                    xhr.onerror = function(e) {
                      Ti.UI.createAlertDialog({title:'Error', message:e.error}).show();
                      Ti.API.info('IN ERROR ' + e.error);
                    };
                    xhr.onload = function(e) {
                      Ti.UI.createAlertDialog({
                          title:        'Cool',
                          message:    'Your photo was uploaded to ' + Titanium.App.Properties.getString('currentEvent_Title')
                      }).show();
                      Ti.API.info('IN ONLOAD ' + this.status + ' readyState ' + this.readyState);
                    };
                    //xhr.onsendstream = function(e) {
                    xhr.onsendstream = function(e) {
                        //uploadProgressBar.value = e.progress;
                        eventLabel.text = 'Upload progress: ' + e.progress + '%';
                      Ti.API.info('ONSENDSTREAM - PROGRESS: ' + e.progress);
                    };
                    xhr.open('POST', 'http://dev.pulsecamera.com/api/upload/photo');
                    xhr.send({
                        image:        picturePreview.image,    // fullResPicture.image,
                        event_id:    Titanium.App.Properties.getString('currentEvent_ID'),
                        platform:    Titanium.Platform.name
                    });
— asked October 24th 2010 by Alexander Stone
  • android
  • onsendstream
  • upload
  • xhr
0 Comments

1 Answer

  • It's not implemented yet. Set a watch on Ticket 1710

    — answered October 24th 2010 by Don Thorp
    permalink
    1 Comment
    • I can't login to this ticket but is it implemented now (2 years later). Still not working for me..

      — commented September 26th 2012 by Oscar Kneib
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.