Internet file - Read to String, not to FolderItem?

I’m trying to read the content of a small file from a (my) website. In this file, I keep the latest release number of my sw app. Seems to me a simple way to check for the latest release.

It’s not to difficult to download the file and read the contents using a URLConnection. Something like:
FileDownloader.Send("GET", UrlMyFileTxt, outputFile, 30).

But, for this purpose, it would be even simpler to directly read it to a string variable. I can’t find it in the documentation, although that might be caused by the fact that these are my first steps on reading data from the internet using Xojo.

Is there such a method, reading direct to a string without writing to disk first?

The Send method has several variants (you can see them in the documentation).

As said in the documentation, two examples:
MyConnection.Send(“GET”,URL)
This will call the ContentReceived event to get the result.

Or a sync version:
Var content As String=MyConnection.SendSync(“GET”, URL)

HTH

Ah, I had seen that but couldn’t get it working. But I missed the step in adding the EventHandler…
Now it does work :grinning:
Thanks!

1 Like