btpoole
12 years agoChannel Surfer
roUrlTransfer ??
Need some help. I am working on a private channel. Included in my pkg I have a folder called channel. In the folder I have a single txt file with up to (3) lines text. The text is basic info about about the channel. Once the channel is selected, the server will need to read the text file. I first wanted to copy the txt file from the roku down to the server but have not been successful in doing that so I thought about using a url transfer as follows:
channelinfo=ReadAsciiFile("pkg:/channel/channel.txt")
xfer=CreateObject("roUrlTransfer")
xferport=CreateObject("roMessagePort")
xfer.SetMessagePort(xferport)
channelfile="http://xxx.xxx.xxx.xxx/channelinfo.php?channelfile=" + channelinfo
xfer.SetUrl(channelfile)
response= xfer.AsyncGetToString()
I know the above works, I can use a print statement on the channelinfo and it shows the text in the debug console. The exact url transfer works on another function I am running to get the roku ip, pass it to php, save to server. All that works. For some reason it doesn't work for passing the channelinfo to the server. Any advice or help would be appreciated. If I can just copy the file down from roku that would be great.
Thanks
channelinfo=ReadAsciiFile("pkg:/channel/channel.txt")
xfer=CreateObject("roUrlTransfer")
xferport=CreateObject("roMessagePort")
xfer.SetMessagePort(xferport)
channelfile="http://xxx.xxx.xxx.xxx/channelinfo.php?channelfile=" + channelinfo
xfer.SetUrl(channelfile)
response= xfer.AsyncGetToString()
I know the above works, I can use a print statement on the channelinfo and it shows the text in the debug console. The exact url transfer works on another function I am running to get the roku ip, pass it to php, save to server. All that works. For some reason it doesn't work for passing the channelinfo to the server. Any advice or help would be appreciated. If I can just copy the file down from roku that would be great.
Thanks