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
});
1 Answer
-
It's not implemented yet. Set a watch on Ticket 1710