[TIMOB-2050] Android: POST with file/blob parameter will cause issue with rails
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:57:55.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | Android |
Labels | android, httpclient, xhr |
Reporter | Jeff Haynie |
Assignee | Jeff Haynie |
Created | 2011-04-15T03:09:03.000+0000 |
Updated | 2011-04-17T01:57:55.000+0000 |
Description
Seems like Ruby on Rails doesn't like a Content-Type header along side a form-data multipart. It will attempt to convert normal form/data key/value pairs into a File Attachment (containing the value) instead.
In iPhone, this Content-Type header is not present and it works fine. So, for normal fields, we should be suppressing this header field to have the same behavior as iOS. Removing this field causes it to work OK.
(from [410b2dea89339e948cec2626e1c93822ed556048]) [#2050 state:fixed-in-qa] fixed android issue related to POST with Content-Type for a plain form/data field http://github.com/appcelerator/titanium_mobile/commit/410b2dea89339e948cec2626e1c93822ed556048"> http://github.com/appcelerator/titanium_mobile/commit/410b2dea89339...
How can Thomas reproduce this to move it to a resolved state?
the easiest way is to:
build a simple RoR app that will print out the values of the incoming post fields. the non-file fields should be text
post a mixed POST with both a file and key/value pairs
Thomas, I can also share the customer client code if you'd like.
I verified that this works on 1.5.0, Android 2.2 and 2.1. Here's my Rails controller code:
And the Titanium code:
closing due to Kevins awesomeness