{ "id": "120041", "key": "TIMOB-15243", "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": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2013-09-17T23:08:26.000+0000", "created": "2013-09-17T08:28:01.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "filesystem", "ios7", "mobile" ], "versions": [], "issuelinks": [ { "id": "31925", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "115903", "key": "TIMOB-14231", "fields": { "summary": "iOS7: Can't read a file from the Resources folder", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-31T20:33:07.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "I use this code:\n\n{code}\nvar f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,\"test.pdf\");\nvar ret = f.write(this.responseData);\n{code}\n\nAfter \"f.nativePath\" value is:\n \nfile:///Users/marco/Library/Application%20Support/iPhone%20Simulator/7.0/Applications/A7304977-7E4F-489D-A143-045F52975DED/MyApp.app/file:/Users/marco/Library/Application%2520Support/iPhone%2520Simulator/7.0/Applications/A7304977-7E4F-489D-A143-045F52975DED/Documents/test.pdf \n\nand i can't load this url from webview or documentviewer\n\nAny suggestion please?", "attachment": [], "flagged": false, "summary": "iOS7: Saving file to applicationDataDirectory results in incorrect path", "creator": { "name": "markinux", "key": "markinux", "displayName": "Marco Aiello", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "markinux", "key": "markinux", "displayName": "Marco Aiello", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "271463", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "# Which version of the SDK are you using? are you using 3.1.3?\r\n# Does the file save without error? It's just the display that is the problem?\r\n# What if you try and manually find that URL on your computer?\r\n# I assume this is the simulator, yes?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-17T12:22:12.000+0000", "updated": "2013-09-17T12:22:12.000+0000" }, { "id": "271468", "author": { "name": "markinux", "key": "markinux", "displayName": "Marco Aiello", "active": true, "timeZone": "America/Los_Angeles" }, "body": "1. ios sdk 7.0, Titanium Studio 3.1.2 GA\n2. no, file is not saved!\n3. folder/file not found - file not saved!\n4. yes, simulator\n", "updateAuthor": { "name": "markinux", "key": "markinux", "displayName": "Marco Aiello", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-17T12:52:13.000+0000", "updated": "2013-09-17T12:52:13.000+0000" }, { "id": "271469", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Please try the latest 3.1.3 SDK (http://builds.appcelerator.com.s3.amazonaws.com/index.html#3_1_X). 3.1.2 may not work on iOS 7.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-17T13:02:43.000+0000", "updated": "2013-09-17T13:02:43.000+0000" }, { "id": "271477", "author": { "name": "markinux", "key": "markinux", "displayName": "Marco Aiello", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I've updated Titanium with the latest SDK (3.1.3) but nothing ... always the same problem ...", "updateAuthor": { "name": "markinux", "key": "markinux", "displayName": "Marco Aiello", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-17T14:42:50.000+0000", "updated": "2013-09-17T14:42:50.000+0000" }, { "id": "271499", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can you please post the updated URL you get when saving the file with 3.1.3, and the exact SDK version you are using?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-17T16:26:34.000+0000", "updated": "2013-09-17T16:26:34.000+0000" }, { "id": "271603", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This is the code we used for testing\n{code}\nvar url = \"http://www.appcelerator.com/assets/The_iPad_App_Wave.pdf\";\n var client = Ti.Network.createHTTPClient({\n // function called when the response data is available\n onload : function(e) {\n Ti.API.info(\"SUCCESS\");\n var f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,\"test.pdf\");\n f.write(this.responseData);\n Ti.API.info(f.nativePath);\n\n var docViewer = Ti.UI.iOS.createDocumentViewer({\n url:f.nativePath\n })\n docViewer.show();\n },\n // function called when an error occurs, including a timeout\n onerror : function(e) {\n Ti.API.info(e.error);\n },\n timeout : 5000 // in milliseconds\n });\n // Prepare the connection.\n client.open(\"GET\", url);\n // Send the request.\n client.send();\n{code}", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-09-17T23:08:11.000+0000", "updated": "2013-09-17T23:08:11.000+0000" }, { "id": "271758", "author": { "name": "kosso", "key": "kosso", "displayName": "kosso", "active": true, "timeZone": "Europe/London" }, "body": "Check to see if Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory is returning a trailing slash or not. \r\n\r\nI have found a couple of occasions over the past few versions of the Ti SDK where this is inconsistent, causing double-slash paths to crop in to apps here and there. \r\n\r\n \r\n", "updateAuthor": { "name": "kosso", "key": "kosso", "displayName": "kosso", "active": true, "timeZone": "Europe/London" }, "created": "2013-09-18T16:23:11.000+0000", "updated": "2013-09-18T16:23:11.000+0000" }, { "id": "271813", "author": { "name": "kosso", "key": "kosso", "displayName": "kosso", "active": true, "timeZone": "Europe/London" }, "body": "Is this related? https://developer.appcelerator.com/question/153484/ios-7-compatibility-with-titanium-app#answer-264403", "updateAuthor": { "name": "kosso", "key": "kosso", "displayName": "kosso", "active": true, "timeZone": "Europe/London" }, "created": "2013-09-18T19:23:40.000+0000", "updated": "2013-09-18T19:23:40.000+0000" }, { "id": "416531", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Unable to reproduce this issue, tested with the following environment; \r\niPhone 7 and Simulator (10.2) \r\nMacOS 10.11.6 (15G31) \r\nStudio 4.8.1.201612050850 \r\nTi SDK 6.0.2 GA \r\nAppc NPM 4.2.8 \r\nAppc CLI 6.1.0 \r\nTi CLI 5.0.11 \r\nAlloy 1.9.5 \r\nArrow 1.10.1 \r\nXcode 8.2 (8C38) \r\nNode v4.6.0 \r\nJava 1.7.0_80", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-31T20:33:07.000+0000", "updated": "2017-03-31T20:33:07.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }