[TIMOB-6973] Android: HTTPClient - Sending blobs as form data fails in 1.8.0.1
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-01-23T16:13:03.000+0000 |
Affected Version/s | Release 1.8.0.1 |
Fix Version/s | Sprint 2012-01, Release 2.0.0, Release 1.8.1 |
Components | Android |
Labels | module_network, parity, qe-testadded, regression |
Reporter | Tony Lukasavage |
Assignee | Josh Roesslein |
Created | 2012-01-04T09:49:10.000+0000 |
Updated | 2014-03-13T17:45:14.000+0000 |
Description
Attachments
File | Date | Size |
---|---|---|
error.png | 2012-01-04T09:49:10.000+0000 | 59648 |
I get a slightly different error when form posting a blob (photo either from the camera or gallery) org.apache.http.entity.mime.content.FileBody Is this the same bug?
[PR #1158](https://github.com/appcelerator/titanium_mobile/pull/1158) sent. This also fixes TIMOB-6411, so both tickets should be tested and resolved.
Closing bug. Verified fix on: SDK build: 1.9.0.v20120113141633 Runtime: V8, Rhino Titanium Studio, build: 1.0.8.201201122152 Device: Droid 3 (2.3.4)
Is there any idea on when this will be released in code? This is a huge blocker that is preventing me from porting my app to Ti 1.8 and I would really like to take advantage of V8.
This fix is already in a CI build so you try it right away.
Reopening and closing this issue to update label and Fix Version field.
updated labels
The following function is working fine on IPhone. but when I am trying to upload image in android, no error message generated but image is not uploaded. function uploadImage() { var db = Titanium.Database.open(Titanium.Locale.getString('database_file_name')); var query = 'select * from ' + Titanium.Locale.getString('database_table_name') + ' where isUpload = 0'; var resultSet = db.execute(query); if(resultSet.rowCount > 0) { Titanium.App.Properties.setBool('isUploadRunning', true); var imageID = resultSet.fieldByName('businessCardId'); var image = Ti.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory + resultSet.fieldByName('imageFile')); var blob = image.read(); resultSet.close(); db.close(); Titanium.API.error('Web Service Call ' + image.getNativePath()); var request = Titanium.Locale.getString('app_url_other') + Titanium.Locale.getString('web_service_UploadCardPhoto'); Titanium.API.error('Web Service Call ' + request); var req = Titanium.Network.createHTTPClient({ timeout : 1600000, onload : function(e) { Titanium.API.error('Web Service Response - On Image Upload ' + this.responseText); var data = JSON.parse(this.responseText) if(data.status == true) { Titanium.App.Properties.setBool('isUploadRunning', false); Titanium.API.error('UserToken is ' + Titanium.App.Properties.getString('UserToken')); var db = Titanium.Database.open(Titanium.Locale.getString('database_file_name')); db.execute('UPDATE ' + Titanium.Locale.getString('database_table_name') + ' SET imageID=?, isUpload=1 WHERE businessCardId=?', data.data, imageID); db.close(); } else { Titanium.API.error('Response Status false ' + data.message + ' Code ' + data.code); } }, onerror : function(e) { Titanium.API.error('Web Service Response - On Error' + this.responseText); var alertDialog = Titanium.UI.createAlertDialog({ title : 'Alert', message : Titanium.Locale.getString('internet_connection_not_available'), buttonNames : ['OK'] }); alertDialog.show(); } }); req.open('POST', request); req.setRequestHeader("ContentType", "multipart/form-data"); req.send({ 'aToken' : Titanium.Locale.getString('application_token'), 'uToken' : Titanium.App.Properties.getString('UserToken'), 'fileType' : 2, 'fileObject' : blob }); } }
updated to 1.8.1 but not working image upload.
This issue latest notification was not sent due to JIRA mail setting. Fixed now. Please check the issue for latests changes.
Note to QE: Gathering more information about AvtarSingh Suchariya's bug
Avtar, can you please contact me at mpmiranda@appcelerator.com so I can help you with this issue? Best, Mauro
Mauro Parra-Miranda I mailed you regarding this.
Anvil test case added. PR link: https://github.com/appcelerator/titanium_mobile/pull/5011