{ "id": "63960", "key": "TIMOB-3328", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-06-05T22:57:19.000+0000", "created": "2011-04-15T03:42:13.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "image", "photo", "upload" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-05T22:57:19.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": "{html}

Uploading a photo works maybe 1 out of 10 times. A perfect\nexample is to load the Kitchen Sink app onto your iPhone and goto\nXHR -> file upload.

\n

Our app uses this same approach and we get the same unfortunate\nfailures. Our server throws the following error:

\n

Status: 500 Internal Server Error bad content body

\n
\n/usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/utils.rb:467:in `parse_multipart'\n
\n

Please advise because this is extremely important to us and it\nseems to have been an issue for a few months because here is a post\nfrom someone experiencing a similar issue:

\n

\nhttp://developer.appcelerator.com/question/95661/image-upload-image...

{html}", "attachment": [], "flagged": false, "summary": "xhr photo upload broken on device", "creator": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "130531", "author": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I just found that this issue is not just isolated to the\ndevice...it fails on the simulator too, just not as often.

{html}", "updateAuthor": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:42:13.000+0000", "updated": "2011-04-15T03:42:13.000+0000" }, { "id": "130532", "author": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I discovered that uploading to a server on your local computer\nfrom the simulator always works, so it seems to be only be an issue\nwhen uploading to a remote server.

{html}", "updateAuthor": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:42:14.000+0000", "updated": "2011-04-15T03:42:14.000+0000" }, { "id": "130533", "author": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Here is another post from Q&A that is experiencing the same\nissues:

\n

\nhttp://developer.appcelerator.com/question/109191/file-upload-fail

{html}", "updateAuthor": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:42:14.000+0000", "updated": "2011-04-15T03:42:14.000+0000" }, { "id": "130534", "author": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I discovered if you comment out these lines of code (201 - 203)\nin ASIFormDataRequest.m everything works just fine:

\n

// if ([[self fileData] count] > 0) { // [self\nsetShouldStreamPostDataFromDisk:YES]; // }

\n

This seems to be related to a rack 1.1.0 parsing issue with\nrails 2.3.x that is supposed to be fixed in rails 3.x with rack\n1.2.x, but if anyone is running rails 2.3.x they will encounter\nthese problems and have to comment out the 3 lines of code\nabove.

\n

Also you may want to test this with Engine Yard since you are\npartnering with them.

\n

Best,

\n

Brian

{html}", "updateAuthor": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:42:14.000+0000", "updated": "2011-04-15T03:42:14.000+0000" }, { "id": "130535", "author": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I looked into the ASI framework some more and found that they\nrecommend you set shouldAttemptPersistentConnection to NO. This\nseems to do the trick even better. So instead of commenting out\nlines (201 - 203) in ASIFormDataRequest.m, all you have to do is\nupdate the TiNetworkHTTPClientProxy.m on line 346 to [request\nsetShouldAttemptPersistentConnection:NO];

{html}", "updateAuthor": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:42:14.000+0000", "updated": "2011-04-15T03:42:14.000+0000" }, { "id": "130536", "author": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Wow...just found the undocumented setting, \"enableKeepAlive\" for\ncreateHTTPClient. Doing the following fixes the issue:

\n

xhr = Titanium.Network.createHTTPClient({

\n
\n    enableKeepAlive:false\n});\n
\n

Please update the docs and let people know that when uploading\nimages to set enableKeepAlive to false.

{html}", "updateAuthor": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:42:14.000+0000", "updated": "2011-04-15T03:42:14.000+0000" }, { "id": "133294", "author": { "name": "tom", "key": "tom", "displayName": "tom quas", "active": true, "timeZone": "Europe/Berlin" }, "body": "Confirmed, we're having these kind of issues w/ Google App Engine's Images API with weak cell signal / EDGE networks.", "updateAuthor": { "name": "tom", "key": "tom", "displayName": "tom quas", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-05-06T22:40:59.000+0000", "updated": "2011-05-06T22:40:59.000+0000" }, { "id": "421055", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This version of Kitchen Sink is no longer supported.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-05T22:57:19.000+0000", "updated": "2017-06-05T22:57:19.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }