I am using SimplePoster.brs, How can we achieve below functionality.
From XML Feed, I get an image name, I want to check whether that file exists, if it doesn't exist then i need to show a default image
This is what i want to do, how to check the file_exists functionality in BrightScript ?
if(file_exists(currShow@hdImg)) Item.hdImg = validstr(currShow@hdImg) else Item.hdImg = "pkg:/images/default.png" end if
For now when I try to use an non exisitng file name i am getting error, ***ERROR: Missing or invalid PHY After searchng forums, i got to know that we can do error_handling using Eval(), but can some one explain how to use it in above scenario ?
To check for the existence of a local file, the roFileSystem component has an Exists() function.
If you want to check for the existence of a remote file, you could use the roURLTransfer component to perform a head request on the URL. Doing so for every poster item in your channel would probably cause performance issues though.