You find this example project in your Plugins Download as a Xojo project file within the examples folder: /CURL/FTP/CURLS ftp download to desktop
Class MainWindow Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
dim url as string = Self.url.text
dim parts() as string = split(url, "/")
dim name as string = parts(UBound(parts))
dim DestinationFile as FolderItem = SpecialFolder.Desktop.Child(name)
DoDownload url, DestinationFile
End EventHandler
End Control
Control URL Inherits TextField
ControlInstance URL Inherits TextField
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control ResultText Inherits Label
ControlInstance ResultText Inherits Label
End Control
Control TextArea1 Inherits TextArea
ControlInstance TextArea1 Inherits TextArea
End Control
Private Sub DoDownload(URL as string, dest as FolderItem)
d = new CURLSMBS
if not d.CreateMTOutputFile(dest) then
MsgBox "Failed to create file."
Return
end if
d.OptionURL = URL
// optional with credentials
'd.OptionUsername = "xxx"
'd.OptionPassword = "xxx"
// timeouts
'd.OptionConnectionTimeout = 10
'd.OptionTimeOut = 60
// more flags
d.OptionVerbose = true
d.OptionSSLVerifyHost = 0
d.OptionSSLVerifyPeer = 0
Result = d.PerformMT
d.CloseMTOutputFile
// show result
dim s as string = d.OutputData
if s.Encoding = nil then
s = DefineEncoding(s, encodings.ISOLatin1)
end if
s = ReplaceLineEndings(s, EndOfLine)
TextArea1.text = s
ResultText.text = "Result: "+str(result)
d = nil
End Sub
Property Private DestinationFile As FolderItem
Property Result As Integer
Property Private d As CURLSMBS
Property Private done As Boolean
End Class
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class