Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6973] Android: HTTPClient - Sending blobs as form data fails in 1.8.0.1

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-01-23T16:13:03.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sSprint 2012-01, Release 2.0.0, Release 1.8.1
ComponentsAndroid
Labelsmodule_network, parity, qe-testadded, regression
ReporterTony Lukasavage
AssigneeJosh Roesslein
Created2012-01-04T09:49:10.000+0000
Updated2014-03-13T17:45:14.000+0000

Description

Attachments

FileDateSize
error.png2012-01-04T09:49:10.000+000059648

Comments

  1. Gerry High 2012-01-04

    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?
  2. Josh Roesslein 2012-01-11

    [PR #1158](https://github.com/appcelerator/titanium_mobile/pull/1158) sent. This also fixes TIMOB-6411, so both tickets should be tested and resolved.
  3. Wilson Luu 2012-01-13

    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)
  4. Jason Sznol 2012-01-20

    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.
  5. Neeraj Gupta 2012-01-20

    This fix is already in a CI build so you try it right away.
  6. Neeraj Gupta 2012-01-23

    Reopening and closing this issue to update label and Fix Version field.
  7. Wilson Luu 2012-02-02

    updated labels
  8. AvtarSingh Suchariya 2012-02-06

    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 }); } }
  9. AvtarSingh Suchariya 2012-02-06

    updated to 1.8.1 but not working image upload.
  10. Nikolai Derzhak 2012-02-06

    This issue latest notification was not sent due to JIRA mail setting. Fixed now. Please check the issue for latests changes.
  11. Wilson Luu 2012-02-13

    Note to QE: Gathering more information about AvtarSingh Suchariya's bug
  12. Mauro Parra-Miranda 2012-02-15

    Avtar, can you please contact me at mpmiranda@appcelerator.com so I can help you with this issue? Best, Mauro
  13. AvtarSingh Suchariya 2012-02-16

    Mauro Parra-Miranda I mailed you regarding this.
  14. jithinpv 2013-11-25

    Anvil test case added. PR link: https://github.com/appcelerator/titanium_mobile/pull/5011

JSON Source