{"action":"closed","issue":{"url":"https://api.github.com/repos/driftyco/ng-cordova/issues/349","labels_url":"https://api.github.com/repos/driftyco/ng-cordova/issues/349/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ng-cordova/issues/349/comments","events_url":"https://api.github.com/repos/driftyco/ng-cordova/issues/349/events","html_url":"https://github.com/driftyco/ng-cordova/issues/349","id":44588882,"number":349,"title":"downloadFile failed (need native path url to write the file)","user":{"login":"cduret","id":1586519,"avatar_url":"https://avatars.githubusercontent.com/u/1586519?v=3","gravatar_id":"","url":"https://api.github.com/users/cduret","html_url":"https://github.com/cduret","followers_url":"https://api.github.com/users/cduret/followers","following_url":"https://api.github.com/users/cduret/following{/other_user}","gists_url":"https://api.github.com/users/cduret/gists{/gist_id}","starred_url":"https://api.github.com/users/cduret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cduret/subscriptions","organizations_url":"https://api.github.com/users/cduret/orgs","repos_url":"https://api.github.com/users/cduret/repos","events_url":"https://api.github.com/users/cduret/events{/privacy}","received_events_url":"https://api.github.com/users/cduret/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/driftyco/ng-cordova/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-10-01T17:00:25Z","updated_at":"2015-02-07T04:52:10Z","closed_at":"2015-02-07T04:52:10Z","body":"I had to hack the downloadFile function  to make it work :\r\n````\r\ndownloadFile: function (source, filePath, trustAllHosts, options) {\r\n        var q = $q.defer();\r\n        var fileTransfer = new FileTransfer();\r\n        var uri = encodeURI(source);\r\n\r\n        fileTransfer.onprogress = function (progressEvent) {\r\n          q.notify(progressEvent);\r\n        };\r\n\r\n        getFilesystem().then(\r\n          function (filesystem) {\r\n\r\n            fileTransfer.download(\r\n              uri,\r\n              filesystem.root.toURL() + filePath,\r\n              function (entry) {\r\n                q.resolve(entry);\r\n              },\r\n              function (error) {\r\n                q.reject(error);\r\n              },\r\n              trustAllHosts, options);\r\n\r\n          });\r\n\r\n        return q.promise;\r\n      }\r\n```"}}