{ "id": "93846", "key": "TIMOB-9797", "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": [ { "id": "13503", "description": "Sprint 2012-14 Core", "name": "Sprint 2012-14 API", "archived": true, "released": true, "releaseDate": "2012-07-13" }, { "id": "14096", "description": "Release 2.1.2", "name": "Release 2.1.2", "archived": true, "released": true, "releaseDate": "2012-08-31" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-08-14T17:01:43.000+0000", "created": "2012-06-25T15:19:47.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "api" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-08-14T19:23:25.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h6.Issue\r\nHTTP Post a photo that will be saved at Internal phone storage\r\n\r\nh6.Tested on\r\nDroid Razr 2.3.5\r\n\r\nh6.Repro steps\r\n1) Run code below & pick up an image from the gallery\r\n2) Wait till the image gets uploaded\r\n3) Go through with any File Manager app to monitor Internal phone storage directory. Notice the uploaded image is present at such location having a similar file name: \"tixhr***.jpeg\"\r\n\r\nh6.Repro sequences\r\n- app.js\r\n{code}\r\nTitanium.Media.openPhotoGallery({\r\n\tsuccess:function(event){\r\n\r\n\t\tvar myImage = event.media;\r\n\r\n\t\tvar xhr = Titanium.Network.createHTTPClient();\r\n\t\txhr.open('POST','http://192.168.0.100/upload.php');\r\n\t\txhr.onerror = function(e){alert(e.error);};\r\n\t\txhr.setTimeout(200000);\r\n\t\txhr.onload = function(e){\r\n\t\t\tTi.UI.createAlertDialog({title:'Success', message: this.responseText\r\n\t\t}).show();\t\t\t\r\n\t\t};\r\n\t\txhr.onsendstream = function(e){Ti.API.info(e);};\r\n\t\txhr.setRequestHeader(\"contentType\", \"multipart/form-data\");\r\n\t\txhr.send({uploadedfile:myImage});\r\n\r\n\t},\r\n\tcancel:function(){\r\n\r\n\t},\r\n\terror:function(error){\r\n\t},\r\n\tmediaTypes:[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO]\r\n});\r\n{code}\r\n\r\n- upload.php\r\n{code}\r\n\r\n{code}\r\n\r\nh6.Work around\r\nWalk through all files that start with the name \"tixhr\" to manually purge them.", "attachment": [], "flagged": false, "summary": "Android: HTTP Post will save a photo at Internal phone storage", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK 2.0.1.GA2, 2.0.2.GA & 2.1.0.v20120622174154\r\nAndroid OS 2.3.5", "comment": { "comments": [ { "id": "200934", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Another test case:\r\napp.js\r\n{code}\r\nTitanium.Media.openPhotoGallery({\r\n success:function(event){\r\n \r\n var myImage = event.media;\r\n \r\n var xhr = Titanium.Network.createHTTPClient();\r\n xhr.open('POST','http://10.0.15.40:8888/upload.php');\r\n xhr.onerror = function(e){alert(e.error);};\r\n xhr.setTimeout(200000);\r\n xhr.onload = function(e){\r\n Ti.UI.createAlertDialog({title:'Success', message: this.responseText\r\n }).show(); \r\n };\r\n //xhr.onsendstream = function(e){Ti.API.info(e);};\r\n xhr.setRequestHeader(\"contentType\", \"multipart/form-data\");\r\n xhr.send({uploadedfile:myImage, uploadedfile2:myImage, uploadedfile3:myImage});\r\n \r\n },\r\n cancel:function(){\r\n \r\n },\r\n error:function(error){\r\n },\r\n mediaTypes:[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO]\r\n});\r\n{code}\r\nupload.php\r\n{code}\r\n\r\n{code}\r\n\r\nTest steps:\r\n1. run app.js\r\n2. select an image\r\n3. should see an alert \"Success: \"\r\n4. check the files in the phone (using something like ASTRO). Before my fix, there are several image files named like \"tixhr*.jpeg\". After my fix, there are no temporary image files.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-29T13:41:31.000+0000", "updated": "2012-07-05T11:19:58.000+0000" }, { "id": "200937", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/2498", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-29T13:56:25.000+0000", "updated": "2012-07-02T17:52:15.000+0000" }, { "id": "214495", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "2_1_X PR [2744|https://github.com/appcelerator/titanium_mobile/pull/2744]", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-14T17:01:09.000+0000", "updated": "2012-08-14T17:01:09.000+0000" }, { "id": "214496", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening issue to add FixVersion 2.1.2", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-14T17:01:31.000+0000", "updated": "2012-08-14T17:01:31.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }