[TIMOB-2036] Sending blob with Titanium.Network.HTTPClient POST sends file without extension
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2011-07-11T10:14:29.000+0000 |
Affected Version/s | Release 1.7.1 |
Fix Version/s | Sprint 2011-26 |
Components | Android |
Labels | android, extension, httpclient, mimetype |
Reporter | cfenzo |
Assignee | Don Thorp |
Created | 2011-04-15T03:08:44.000+0000 |
Updated | 2011-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"));
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?
this was a duplicate of 4519. However, THomas would like to verify this specific case.
Tested with test file from 4519 with Nexus S 2.3.4 and Nexus One 2.2.2 with 1.7.2.v20110630161836