Help Example for WebFile

In the documentation for WebFile, there is an example for downloading a file when a WebButton is clicked. However, in the example, there is a comment that says “// MyFile is a property on the App object”. However, it doesn’t specify Property Type it’s suppose to be defined as. And, I’m just novice enough to not be able to guess what it should be.

Any help would be appreciated!

Dim f As FolderItem = GetFolderItem("MyFile.txt") If f <> Nil And f.Exists Then App.MyFile = WebFile.Open(f) // MyFile is a property on the App object App.MyFile.ForceDownload = True End If

The MyFile property should be a WebFile

Perfect, Tim! Thank you!

I’m wondering if someone at Xojo can update the documentation for this example? Maybe?


For a hint on how to solve it, when you look at the documentation for WebFile.Open() you can see it returns a WebFile

Knowing what WebFile.Open() returns means that we know what App.MyFile needs to be to assign it :slight_smile: