Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2115] Android: HttpClient file uploads result in different MIME encoding than iOS

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2013-12-23T01:10:13.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, httpclient
ReporterVance Lucas
AssigneeRitu Agrawal
Created2013-10-02T17:39:25.000+0000
Updated2016-03-08T07:41:05.000+0000

Description

I have created a Gist to demonstrate this issue: https://gist.github.com/vlucas/6796953 The end result is that the MIME envelope that Android sends cannot be parsed or decoded by PHP, while the same code run on iPhone can be decoded by PHP and works as expected.

Comments

  1. Mostafizur Rahman 2013-10-09

    Hello Vance Lucas, Please check your by removing
     c.setRequestHeader('Content-Type', 'multipart/form-data');
    It’s working for me and I hope it’s solved your problem. Thanks
  2. Vance Lucas 2013-10-09

    That does work for me actually (Thanks!), but I still think this issue itself is a bug since it is the correct content-type to send, and it works flawlessly on iOS. It is a surprising behavior, and very unexpected on Android, which is what led me to believe it was a bug in the Android implemenation.
  3. Vance Lucas 2013-10-10

    This is very clearly reproducible! It only doesn't happen if you don't send any Content-Type header at all. This is a difference from how it is handled on iOS with the same exact code, and WILL confuse users (like me). PLEASE reconsider actually fixing this to work the same on both platforms as it should.
  4. Ritu Agrawal 2013-12-23

    Reopening this ticket as we can reproduce this issue with Android platform.
  5. Ritu Agrawal 2013-12-23

    Thanks for reporting this issue. Resolving this ticket as a duplicate as this issue is already covered by existing tickets (TIMOB-15510 and TIMOB-15514). Please watch these two tickets for further updates.

JSON Source