How to upload a file?

Is it possible to simply download, in a few lines, a file (zip or dmg) on a web server, without using a heavy toolbox like Kaju (stayed in API 1) and others? with the sockets for example? I’m talking about downloading, not installing.

There’s a Desktop example project for downloading a file with URLConnection

For 2022r4 examples it can be found at

Example Projects/Networking/URLConnection/Downloading Files.xojo_binary_project

Thanks !

Curiously, all the names of the files downloaded by this routine begin with a slash!

Var filenameLength As Integer
For i As Integer = url.Length - 1 DownTo 0
  If url.Middle(i, 1) = "/" Then
    filenameLength = url.Length - i
    Exit For
  End If

Var filename As String
filename = url.Right(filenameLength)