Forum Discussion

rockstar1's avatar
rockstar1
Visitor
9 years ago

Unable to read .json file in Roku

Hi, from past hours I am trying to read a file from my Roku code, but its unable to read the same.
The path is "pkg:/feed/ads_nonstandard.json", and the file is there at the location also, but when I ReadAsciiFile(filePath), it always return "Unable to read file" error. I even try to see its existence using
LocalFileBrowser = CreateObject("roFileSystem")
print (LocalFileBrowser.exists("pkg:/feed/ads_nonstandard.json"))
but this always return me false. I don't know what is wrong with this, but when i create a xml using eclipse New-> Brightscript Component xml file, the file gets created and LocalFileBrowser shows me true, its true for all the images as well, but not for my .json or .txt file. I have changed the access rights as well for the file, but still I am unable to read my json. Please help!!!!!
  • Have you checked your package's .zip file to see that your Json file is actually there?

    I'm not familiar with Eclipse; I was never able to get it to work. However, it may have a setting where you specify which folders are included in your project's package. Make sure that the /feed folder is included -- or just put it in another folder that you know works (e.g. /xml).