{ "id": "86676", "key": "TIMOB-7713", "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": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2017-07-26T23:46:08.000+0000", "created": "2012-02-17T15:21:08.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api", "parity" ], "versions": [ { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "issuelinks": [ { "id": "15895", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "85506", "key": "TIMOB-7605", "fields": { "summary": "iOS: httpClient file transfers appear to be cached in 1.8.0.1", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-07-26T23:46:08.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": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "Steps to Reproduce:\r\n1. Run the following code:\r\n{code}\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\n\r\nwin1.open();\r\n\r\n/*\r\n * TEST 1.8.X DOWNLOADING THE SAME FILE MULTIPLE TIMES\r\n * \r\n * NOTE: Will need to create: Titanium.Filesystem.applicationDataDirectory + \"/projects/\" + p[1-5] to write into\r\n */\r\n\r\nfor (var i=1; i<=5; i++) {\r\n\tvar file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, \"projects\", \"p\"+i);\r\n\tif (!file.exists()) {\r\n\t\tfile.createDirectory(true);\r\n\t}\r\n}\r\n\r\nfunction jsleep(s){\r\n\ts=s*1000;\r\n\tvar a=true;\r\n\tvar n=new Date();\r\n\tvar w;\r\n\tvar sMS=n.getTime();\r\n\twhile(a){\r\n\t\tw=new Date();\r\n\t\twMS=w.getTime();\r\n\t\tif(wMS-sMS>s) a=false;\r\n\t}\r\n}\r\n\r\nvar button1 = Titanium.UI.createButton({\r\n\ttop:'10', \r\n\ttitle:'Test Downloading Same File 5 Times (1.8.X)',\r\n\twidth:'400',\r\n\theight:'40'\r\n});\r\n\r\nbutton1.addEventListener('click', function()\r\n{\r\ndownloadafile(\"p1\", \"g.jpg\", \"http://www.gonzoville.com/wp-content/uploads/2011/12/0.jpeg\");\r\njsleep(1);\r\ndownloadafile(\"p2\", \"g.jpg\", \"http://www.gonzoville.com/wp-content/uploads/2011/12/0.jpeg\");\r\n//jsleep(1);\r\ndownloadafile(\"p3\", \"g.jpg\", \"http://www.gonzoville.com/wp-content/uploads/2011/12/0.jpeg\");\r\n//jsleep(1);\r\ndownloadafile(\"p4\", \"g.jpg\", \"http://www.gonzoville.com/wp-content/uploads/2011/12/0.jpeg\");\r\n//jsleep(1);\r\ndownloadafile(\"p5\", \"g.jpg\", \"http://www.gonzoville.com/wp-content/uploads/2011/12/0.jpeg\");\r\n\r\n});\r\n\r\nwin1.add(button1);\r\n\r\nTi.API.info(\"BASE PATH: \" + Titanium.Filesystem.applicationDataDirectory);\r\n\r\n\r\n/* NOW LETS MAKE IT WORK WITH 1.8.1 ... NOT! */\r\n\r\nfunction downloadafile(foldername, filename, fileurl) {\r\n\t//var file = Ti.Filesystem.pathFromComponents(Ti.Filesystem.applicationDataDirectory, \"projects\", foldername, filename);\r\n\tvar c = Titanium.Network.createHTTPClient({\r\n\t\ttimeout : 10000,\r\n\r\n\t\tonload : function(e) {\r\n\t\t\tTi.API.info('LOADED ' + filename + \" TO \" + foldername);\r\n\t\t\tTi.API.info(c.status);\r\n\t\t},\r\n\t\tondatastream : function(e) {\r\n\t\t\tTi.API.info('ONDATASTREAM - PROGRESS: ' + e.progress);\r\n\t\t},\r\n\t\tonerror : function(e) {\r\n\t\t\tTi.API.info('XHR Error ' + e.error);\r\n\t\t}\r\n\t});\r\n\t\r\n\tc.clearCookies(\"all\");\r\n\tc.open('GET', fileurl);\r\n\tc.file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory + \"/projects/\" + foldername + \"/\" + filename);\r\n\tc.send();\r\n\r\n}\r\n{code}\r\n\r\nActual:\r\nThe downloaded files are saved on iOS, but not on Android\r\n\r\nExpected:\r\nFor files to be saved to Android", "attachment": [], "flagged": false, "summary": "Parity: Android does not write downloaded file to directory while iOS writes it to the directory", "creator": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Mac 10.6.8 \r\nStudio: Titanium Studio, build: 1.0.9.201202131024\r\nSDK: 1.8.2.v20120216154635\r\nAndroid Emulator 2.2", "comment": { "comments": [ { "id": "424861", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing due to inactivity. If this issue still exists, please raise a new ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-07-26T23:46:08.000+0000", "updated": "2017-07-26T23:46:08.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }