Platforms to show: All Mac Windows Linux Cross-Platform
/CURL/SCP/CURLS scp download picture
Required plugins for this example: MBS CURL Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /CURL/SCP/CURLS scp download picture
This example is the version from Wed, 3rd Jan 2023.
Project "CURLS scp download picture.xojo_binary_project"
FileTypes
Filetype text
End FileTypes
Class Window1 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action()
DoUpload
End EventHandler
End Control
Control ListBox1 Inherits ListBox
ControlInstance ListBox1 Inherits ListBox
End Control
Control URL Inherits TextField
ControlInstance URL Inherits TextField
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Private Sub DoUpload()
dim e as integer
dim d as new CURLSMBS
d.OptionURL=url.text
d.CollectOutputData = True
d.CollectHeaders = True
d.OptionUsername = "test"
d.OptionPassword = "password"
Break // change credentials
e=d.Perform
listbox1.addrow "Result: "+str(e)
Select case e
case d.kError_LOGIN_DENIED
Listbox1.AddRow "Wrong password."
case d.kError_UNSUPPORTED_PROTOCOL
Listbox1.AddRow "Protocol not implemented."
case d.kError_OK
Listbox1.AddRow "No error."
end select
if e = 0 then
dim data as string = d.OutputData
dim pic as Picture = Picture.FromData(data)
if pic<>Nil then
dim pw as new PicWindow
pw.Backdrop = pic
end if
else
dim message as string = d.DebugMessages
Break
end if
End Sub
End Class
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu5 = ""
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
MenuItem UntitledMenu4 = ""
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = ""
End MenuBar
Class App Inherits Application
End Class
Class PicWindow Inherits Window
End Class
End Project
See also:
The items on this page are in the following plugins: MBS CURL Plugin.