Details
-
Type:
Bug
-
Status: Closed
-
Priority:
High
-
Resolution: Fixed
-
Affects Version/s: Release 1.8.0.1, Release 2.0.0
-
Fix Version/s: Sprint 2012-03, Release 2.0.0, Release 1.8.2
-
Component/s: Android
-
Labels:
-
Environment:
Titanium SDK version: 1.8.0.1
Javascript Engine: Rhino / V8
Platform & version: Android 2.3
Device Details: Android emulator
Host Operating System: OSX Lion
Titanium Studio version: 1.0.7
Description
PROBLEM DESCRIPTION
Customer can't upload files thru HTTPClient from Android. Code is working perfect in iOS.
STEPS TO REPRODUCE
1. Create mobile project
2. Paste this code to app.js
var win = Ti.UI.createWindow();
|
|
var image = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,'appc.jpg');
|
|
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.setTimeout(20000);
|
xhr.onload = function(e)
|
{
|
Ti.UI.createAlertDialog({title:'Success', message:'status code ' + this.status}).show();
|
Ti.API.info('IN ONLOAD ' + this.status + ' readyState ' + this.readyState);
|
};
|
xhr.onsendstream = function(e)
|
{
|
Ti.API.info('ONSENDSTREAM - PROGRESS: ' + e.progress);
|
};
|
|
// open the client
|
xhr.open('POST','https://twitpic.com/api/uploadAndPost');
|
|
// send the data
|
xhr.send({media:image,username:'fgsandford1000',password:'sanford1000',message:'check me out'});
|
|
win.open();
|
3. Run this on Android
ACTUAL RESULTS
The upload is not working
EXPECTED RESULTS
The upload working fine, as in iOS.