{ "id": "151568", "key": "AC-400", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2015-11-11T18:45:11.000+0000", "created": "2015-09-29T08:21:41.000+0000", "labels": [ "5.0.0.GA" ], "versions": [], "issuelinks": [], "assignee": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "updated": "2015-11-11T18:45:11.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "When trying to do a POST request in Titanium 5.0.0GA, it works as long as you don't include a file. As soon as a file is included the body of the POST is empty on arrival on the server but the file is still there. This issue only seems to occur on Android, iOS has no problems.\r\n\r\nI've posted this issue on the Community Q&A and other users seem to be having the same problems.", "attachment": [], "flagged": false, "summary": "HTTPClient POST request with file doesn't work on Android", "creator": { "name": "Ventis", "key": "ventis", "displayName": "David Vermeir", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "Ventis", "key": "ventis", "displayName": "David Vermeir", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "365225", "author": { "name": "Ventis", "key": "ventis", "displayName": "David Vermeir", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{code}\r\nvar mediaParams = {\r\n\t\t\tsuccess : function(event) {\r\n\t\t\t\tvar imageBlob = event.media;\r\n register(imageBlob);\r\n\t\t\t},\r\n\t\t\tcancel : function() {\r\n\t\t\t\t\r\n\t\t\t},\r\n\t\t\terror : function() {\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t};\r\nTitanium.Media.openPhotoGallery(mediaParams);\r\n\r\nfunction register(image) {\r\n var registerData = {\r\n username:'test',\r\n avatar:image\r\n };\r\n\r\n\tvar xhr = Ti.Network.createHTTPClient();\r\n\txhr.onload = function() {\r\n\t\t//...\r\n\t};\r\n\txhr.onerror = function(error) {\r\n //...\r\n\t}; \r\n\r\n\txhr.open('POST', 'http://foo.com/register');\r\n\t\r\n\txhr.send(registerData);\r\n}\r\n{code}\r\n", "updateAuthor": { "name": "Ventis", "key": "ventis", "displayName": "David Vermeir", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-09-29T08:30:19.000+0000", "updated": "2015-09-29T08:31:13.000+0000" }, { "id": "369689", "author": { "name": "aislam", "key": "aislam", "displayName": "Aminul Islam", "active": false, "timeZone": "Etc/GMT-6" }, "body": "Hi , \r\nI tested the issue you reported . I can't reproduce it .HTTPClient POST request with file is working fine for me .\r\n*Test Code*\r\n{code}\r\nfunction file_transmit(blob) {\r\n\turl = 'http://abc/send_email.php';\r\n\tvar client = Ti.Network.createHTTPClient({\r\n\t\tonload : function(e) {\r\n\t\t\tvar json = JSON.parse(this.responseText);\r\n\t\t\tTi.API.info('this.responseText' + this.responseText);\r\n\t\t\tif (json.success === true) {\r\n\t\t\t} else {\r\n\t\t\t};\r\n\t\t},\r\n\t\tonerror : function(e) {\r\n\t\t\tTi.API.debug(e.error);\r\n\t\t},\r\n\t});\r\n\tTi.API.info('blob' + blob);\r\n\tclient.open(\"POST\", url);\r\n\tvar params = {\r\n\t\tfileUri : blob\r\n\t};\r\n client.send(params);\r\n}\r\n{code}\r\n\r\n\r\n\r\nEnvironment\r\n{code}\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.10.5\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 8589934592\r\nNode.js\r\n Node.js Version = 0.10.37\r\n npm Version = 1.4.28\r\nTitanium CLI\r\n CLI Version = 5.0.5\r\nTitanium SDK\r\n SDK Version =5.0.2 GA\r\n SDK Path = /Users/Library/Application Support/Titanium/mobilesdk/osx/5.0.2 GA\r\n Target Platform = android\r\n{code}\r\n\r\nThanks", "updateAuthor": { "name": "aislam", "key": "aislam", "displayName": "Aminul Islam", "active": false, "timeZone": "Etc/GMT-6" }, "created": "2015-11-11T06:52:22.000+0000", "updated": "2015-11-11T06:52:51.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }