{"action":"created","issue":{"url":"https://api.github.com/repos/jxcore/jxcore-cordova/issues/73","labels_url":"https://api.github.com/repos/jxcore/jxcore-cordova/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/jxcore/jxcore-cordova/issues/73/comments","events_url":"https://api.github.com/repos/jxcore/jxcore-cordova/issues/73/events","html_url":"https://github.com/jxcore/jxcore-cordova/issues/73","id":107208694,"number":73,"title":"fs.readFile failed on Android","user":{"login":"AlexZhouAA","id":4999956,"avatar_url":"https://avatars.githubusercontent.com/u/4999956?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexZhouAA","html_url":"https://github.com/AlexZhouAA","followers_url":"https://api.github.com/users/AlexZhouAA/followers","following_url":"https://api.github.com/users/AlexZhouAA/following{/other_user}","gists_url":"https://api.github.com/users/AlexZhouAA/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexZhouAA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexZhouAA/subscriptions","organizations_url":"https://api.github.com/users/AlexZhouAA/orgs","repos_url":"https://api.github.com/users/AlexZhouAA/repos","events_url":"https://api.github.com/users/AlexZhouAA/events{/privacy}","received_events_url":"https://api.github.com/users/AlexZhouAA/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-09-18T14:05:30Z","updated_at":"2015-09-18T15:34:19Z","closed_at":"2015-09-18T15:20:43Z","body":"I tried to run code below\r\n<pre><code>\r\n  fs.readFile(path.join(__dirname, \"public/img//products/example.jpg\"), function(err, data){\r\n    if(err) ...\r\n    else ....\r\n  });\r\n</code></pre>\r\nI got error below\r\n <pre><code>\r\n@/data/data/com.does_inc.salesplus/files/www/jxcore/app.js:122:2   handle@/data/data/com.does_inc.salesplus/files/www/jxcore/node_modules/express/lib/router/layer.js:95:5\r\nnext@/data/data/com.does_inc.salesplus/files/www/jxcore/node_modules/express/lib/router/route.js:131:7\r\ndispatch@/data/data/com.does_inc.salesplus/files/www/jxcore/node_modules/express/lib/router/route.js:112:3\r\nhandle@/data/data/com.does_inc.salesplus/files/www/jxcore/node_modules/express/lib/router/layer.js:95:5\r\nnext/<@/data/data/com.does_inc.salesplus/files/www/jxcore/node_modules/express/lib/router/index.js:277:1\r\nprocess_params@/data/data/com.does_inc.salesplus/files/www/jxcore/node_modules/express/lib/router/index.js:330:1\r\nnext@/data/data/com.does_inc.salesplus/files/www/jxcore/node_modules/express/lib/router/index.js:271:5\r\nerror@/data/data/com.does_inc.salesplus/files/www/jxcore/node_modules/express/node_modules/serve-static/index.js:120:7\r\nemit@events.js:82:7\r\nerror@/data/data/com.does_inc.salesplus/files/www/jxcore/node_modules/express/node_modules/send/index.js:245:1\r\nonStatError@/data/data/com.does_inc.salesplus/files/www/jxcore/node_modules/express/node_modules/send/index.js:356:7\r\nnext@/data/data/com.does_inc.salesplus/files/www/jxcore/node_modules/express/node_modules/send/index.js:630:11\r\nonstat@/data/data/com.does_inc.salesplus/files/www/jxcore/node_modules/express/node_modules/send/index.js:619:1\r\nmakeCallback/<@fs.js:84:12\r\n</code></pre>\r\n\r\nPlease Help\r\n"},"comment":{"url":"https://api.github.com/repos/jxcore/jxcore-cordova/issues/comments/141484304","html_url":"https://github.com/jxcore/jxcore-cordova/issues/73#issuecomment-141484304","issue_url":"https://api.github.com/repos/jxcore/jxcore-cordova/issues/73","id":141484304,"user":{"login":"ktrzeciaknubisa","id":5946844,"avatar_url":"https://avatars.githubusercontent.com/u/5946844?v=3","gravatar_id":"","url":"https://api.github.com/users/ktrzeciaknubisa","html_url":"https://github.com/ktrzeciaknubisa","followers_url":"https://api.github.com/users/ktrzeciaknubisa/followers","following_url":"https://api.github.com/users/ktrzeciaknubisa/following{/other_user}","gists_url":"https://api.github.com/users/ktrzeciaknubisa/gists{/gist_id}","starred_url":"https://api.github.com/users/ktrzeciaknubisa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktrzeciaknubisa/subscriptions","organizations_url":"https://api.github.com/users/ktrzeciaknubisa/orgs","repos_url":"https://api.github.com/users/ktrzeciaknubisa/repos","events_url":"https://api.github.com/users/ktrzeciaknubisa/events{/privacy}","received_events_url":"https://api.github.com/users/ktrzeciaknubisa/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T15:34:19Z","updated_at":"2015-09-18T15:34:19Z","body":"I'm not sure, if the permissions would allow this - never tried this myself. Regardless, please keep in mind, that your `./public` folder (or any other folder of your app for that matter), is part of virtual directory structure of the app package (does not reside directly in android's filesystem), thus if you would try to save any file, you would need to create a real `./public` folder in real filesystem and write there."}}