{ "id": "125792", "key": "TIMOB-16380", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "10000", "description": "", "name": "Done" }, "resolutiondate": "2016-03-07T19:15:25.000+0000", "created": "2014-02-03T23:05:50.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "look1" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [], "assignee": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-06T17:34:43.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h3. Steps to Reproduce\r\nUsing the exact example given in the Titanium docs at http://docs.appcelerator.com/titanium/latest/#!/guide/File_Uploads_and_Downloads I am unable to successfully transmit a file on iOS, but it *DOES* work fine on Android. \r\n\r\nInspecting further, the POST request's Content-Type is not getting set properly to 'multipart/form-data' when sent from iOS, but instead is sent as 'application/x-www-form-urlencoded'. The property containing the supposed file will exist, but is merely a string representing the file path (as it exists on the mobile device). \r\n\r\nI've tried manually setting the Content-Type between opening the connection and sending the data, but it appears to be ignored. \r\n\r\nh3. Actual Result\r\nContent Type: application/x-www-form-urlencoded; charset=utf-8\r\n\r\nh3. Expected Result\r\nContent Type: multipart/form-data", "attachment": [], "flagged": false, "summary": "iOS: HTTPClient on iOS will not POST as multipart/form-data (but Android does)", "creator": { "name": "hardwickj", "key": "hardwickj", "displayName": "James Hardwick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "hardwickj", "key": "hardwickj", "displayName": "James Hardwick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium Studio 3.2.0", "closedSprints": [ { "id": 121, "state": "closed", "name": "2014 Sprint 12 SDK", "startDate": "2014-06-09T21:51:17.043Z", "endDate": "2014-06-21T00:00:00.000Z", "completeDate": "2014-06-23T16:52:29.621Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "291013", "author": { "name": "hardwickj", "key": "hardwickj", "displayName": "James Hardwick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I wonder if this is perhaps more of a bug with the underlying method of setting request headers, as no matter what I set, it seems to be getting ignored on iOS, but again, everything is working as expected on Android. ", "updateAuthor": { "name": "hardwickj", "key": "hardwickj", "displayName": "James Hardwick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-03T23:27:28.000+0000", "updated": "2014-02-03T23:27:28.000+0000" }, { "id": "291019", "author": { "name": "hardwickj", "key": "hardwickj", "displayName": "James Hardwick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Possibly related to TIMOB-13163", "updateAuthor": { "name": "hardwickj", "key": "hardwickj", "displayName": "James Hardwick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-03T23:41:47.000+0000", "updated": "2014-02-03T23:41:47.000+0000" }, { "id": "291072", "author": { "name": "hardwickj", "key": "hardwickj", "displayName": "James Hardwick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "To clarify this after a bit more playing around, I'm experiencing this (on iOS) when attempting to use HTTPClient.send() with a File instead of a Blob as part of the data sent. It seems to happen if I'm sending either *just* a File, or a File as a property on a Dictionary/JS Object, ala\r\n{code}\r\nHTTPClient.send(someFile)\r\n{code}\r\nas well as\r\n{code}\r\nHTTPClient.send({myfile: someFile})\r\n{code}\r\n\r\nIf I instead do something such as \r\n{code}\r\nHTTPClient.send({myfile: someFile.read()})\r\n{code}\r\nTHEN this works as expected on iOS.", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-02-04T04:12:05.000+0000", "updated": "2014-06-03T10:19:52.000+0000" }, { "id": "291073", "author": { "name": "hardwickj", "key": "hardwickj", "displayName": "James Hardwick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiNetworkHTTPClientProxy.m#L544\r\n\r\n…appears to only handle the case of a TiBlob, but not a TiFile, hence what I described above. So the parameter types described for the \"data\" property in the docs (http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.Network.HTTPClient-method-send) isn't accurate.", "updateAuthor": { "name": "hardwickj", "key": "hardwickj", "displayName": "James Hardwick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-04T04:15:36.000+0000", "updated": "2014-02-04T04:16:08.000+0000" }, { "id": "291327", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Moving this ticket to engineering based on the detailed analysis from the reporter. Looking at the SDK code, either the code needs to handle File type or documentation needs to be updated. I have not looked at Android code.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-05T07:19:07.000+0000", "updated": "2014-02-05T07:19:07.000+0000" }, { "id": "292113", "author": { "name": "reyjexter", "key": "reyjexter", "displayName": "Rey Bumalay", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I wonder when this will be implemented or at least a temporary workaround to fix this because updating several data with file upload which is optional gets boundary error message. Thanks", "updateAuthor": { "name": "reyjexter", "key": "reyjexter", "displayName": "Rey Bumalay", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-10T03:31:54.000+0000", "updated": "2014-02-10T03:31:54.000+0000" }, { "id": "307313", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This was fixed with the HTTPClient refactor for 3.2.3\r\nThe headers for the sample in the documentation are these:\r\n{code}\r\n\"Content-Length\" = 2886522;\r\n\"Content-Type\" = \"multipart/form-data; charset=utf-8; boundary=0xTibOuNdArY_1401790519\";\r\n{code}", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-06-03T10:17:19.000+0000", "updated": "2014-06-03T10:17:19.000+0000" }, { "id": "308802", "author": { "name": "jerome_is_me", "key": "jerome_is_me", "displayName": "Jérôme Brunel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hello,\r\n\r\nI just made a POST request and sent a JavaScript object to the send method and here is what I see on WireShark:\r\nThe content type is: Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\nThe data sent is: firstname=John&phone=555555555&lastname=Smith&email=johnsmith@doe.com\r\n\r\nWhen I make a Ti.API.info on the JavaScript object right before I send it, I get this printed:\r\n[INFO] : {\r\n[INFO] : email = \"johnsmith@doe.com\";\r\n[INFO] : firstname = John;\r\n[INFO] : lastname = Doe;\r\n[INFO] : phone = 555555555;\r\n[INFO] : }\r\n\r\nFrom what I can see on this JIRA, it should have been fixed with the 3.2.3 refactor, but I use the 3.2.3 and this is not fixed at all.\r\n\r\nJérome", "updateAuthor": { "name": "jerome_is_me", "key": "jerome_is_me", "displayName": "Jérôme Brunel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-06-13T00:10:42.000+0000", "updated": "2014-06-13T00:10:42.000+0000" }, { "id": "439821", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closed as completed. If this is in error, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:34:43.000+0000", "updated": "2018-08-06T17:34:43.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }