Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2036] Sending blob with Titanium.Network.HTTPClient POST sends file without extension

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2011-07-11T10:14:29.000+0000
Affected Version/sRelease 1.7.1
Fix Version/sSprint 2011-26
ComponentsAndroid
Labelsandroid, extension, httpclient, mimetype
Reportercfenzo
AssigneeDon Thorp
Created2011-04-15T03:08:44.000+0000
Updated2011-07-11T10:28:41.000+0000

Description

If you send a blob (image from photogallery for instance) with Titanium.Network.HTTPClient POST, the extension of the file is not set properly. Missing an ".".

The problem is on line 668 in TiHTTPClient.java:

File tmpFile = File.createTempFile("tixhr", TiMimeTypeHelper.getFileExtensionFromMimeType(mimeType, ".txt"));

Because TiMimeTypeHelper.getFileExtensionFromMimeType(mimeType,default) returns the extension without ".", it has to be added, like this:

File tmpFile = File.createTempFile("tixhr", "."+TiMimeTypeHelper.getFileExtensionFromMimeType(mimeType, "txt"));

Comments

  1. Jason Sznol 2011-05-10

    This is a huge issue for our application and is preventing our webservers from handling the photos we upload to it properly. This is such a simple fix, is there anyway we can get this in one of the CI builds so we can build against it?
  2. Kincy Clark 2011-07-11

    this was a duplicate of 4519. However, THomas would like to verify this specific case.
  3. Natalie Huynh 2011-07-11

    Tested with test file from 4519 with Nexus S 2.3.4 and Nexus One 2.2.2 with 1.7.2.v20110630161836

JSON Source