URLTransfer

I have a slideshow. User can select a button “Like This Image” - this gets URLtransfer to download a file to /tmp, but the point is simply accessing the URL, which is a PHP file which sends me email with the name of the image the user clicked on. All this works fine. The problem is it only works with one particular image. It will work repeatedly while on that image. The debugger prints that the proper title/variable is present in the urlTransfer function on all images, but this only works with this particular image, weather its first or 10th in the slideshow. I dont see how the Roku cares which image its on in this case as its getting the proper titles from the variable curr_photo below. Here are the two releveant lines form the code:

UT.SetUrl("http://www.xxx.com/roku/url/thankyou.php?subject=" + curr_photo.GetTitle() + ".roku")
 UT.AsyncGetToFile("tmp:/xx"+ curr_photo.GetTitle())

Totally stumped.
Thanks

What are the titles of some of the photos? Or perhaps it is caching the image so you would need to add a cachebreaker, or delete it from tmp when downloading another image.

We’d also need to know how curr_photo is getting set. My guess is that it’s not getting accurately reset with each new photo.

Hello destruk

The title of the image that works is “Midtown”. Its the first one in that particular slideshow. It also appears in another slideshow at a random location. In both cases the email thing goes through. The second title is “Second Avenue”. It doesn’t work, nor does a couple of others i tried.
Is there something wrong with my /tmp title? It should be making unique names for each as in “xxMidtown”, “xxSecondAvenue” etc. I’m under the impression that I"m solving any cache problems that way, No? Does the Roku check for the existence of the file first, and if its there it doesn’t send the url request? That would definitely indicate a cache problem

How do I delete the file in tmp/ each time? I would try that since its not needed anyway.

Thanks

theEndless -
I have a print command in the function that does all this, and it is printing the proper title each time. There is a canvas that pops up and says “thank you” for 2 seconds and then the debugger prints the proper title, so i think that means the right value is set for that variable, am I wrong about that?

print curr_photo.GetTitle()

thanks

I agree with TheEndless -
You want to watch it work in the debugger and add some prints.
UT.SetUrl(“http://www.xxx.com/roku/url/thankyou.php?subject=” + curr_photo.GetTitle() + “.roku”)
print UT.GetURL()
UT.AsyncGetToFile(“tmp:/xx”+ curr_photo.GetTitle())

The reason for GetURL is to make sure it is properly encoded to grab the correct image from your server script.
Maybe execute your php script manually in a browser with some echo’d debugging information using the URL that was printed for the retrieval request too.
If it’s caching, then you can add a cache breaker using a timestamp on the url request - ie

timestamp=CreateObject(“roDateTime”)
UT.SetUrl(“http://www.xxx.com/roku/url/thankyou.php?subject=” + curr_photo.GetTitle() + “.roku”+“&cache=”+timestamp.AsSeconds())