Platforms to show: All Mac Windows Linux Cross-Platform
/CURL/FTP/CURLS ftp secure upload
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/FTP/CURLS ftp secure upload
This example is the version from Thu, 30th Aug 2017.
Project "CURLS ftp secure upload.xojo_binary_project"
FileTypes
Filetype text
End FileTypes
Class Window1 Inherits Window
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 UploadCURL
d=new UploadCURL
d.InputData="Just a little bit text. Have fun!"
d.OptionURL=url.text
d.OptionUpload=true
'd.OptionUseSSL = d.kFTPSSL_NONE // Don't attempt to use SSL.
'd.OptionUseSSL = d.kFTPSSL_TRY // Try using SSL, proceed as normal otherwise.
d.OptionUseSSL = d.kFTPSSL_CONTROL // Require SSL for the control connection or fail with CURLE_USE_SSL_FAILED.
'd.OptionUseSSL = d.kFTPSSL_ALL // Require SSL for all communication or fail with CURLE_USE_SSL_FAILED.
d.OptionSSLVerifyPeer=0 // don't verify peer
d.OptionSSLVerifyHost=0 // ignore host name in verify
d.OptionUsername = "test"
d.OptionPassword = "xxxx"
e=d.Perform
listbox1.addrow "Result: "+str(e)
End Sub
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
Class UploadCURL Inherits CURLSMBS
EventHandler Sub DebugMessage(infotype as integer, data as string, dataSize as Integer)
System.DebugLog str(infotype)+" "+data
End EventHandler
EventHandler Function Progress(dltotal as Int64, dlnow as Int64, ultotal as Int64, ulnow as Int64, percent as double) As boolean
if ultotal=0 then
window1.listbox1.addrow "Uploading..."
else
window1.listbox1.addrow "Uploading "+Format(ulnow/ultotal,"-0%")+" "+stR(ulnow)+" of "+str(ultotal)
end if
End EventHandler
End Class
End Project
See also:
- /CURL/FTP/CURLS ftp create or folder delete
- /CURL/FTP/CURLS ftp directory browsing
- /CURL/FTP/CURLS ftp directory listing
- /CURL/FTP/CURLS ftp download to desktop
- /CURL/FTP/CURLS ftp file upload
- /CURL/FTP/CURLS ftp file upload direct
- /CURL/FTP/CURLS ftp file upload resume
- /CURL/FTP/CURLS ftp file upload with thread
- /CURL/FTP/CURLS ftp file uploads
- /CURL/FTP/CURLS ftp upload
The items on this page are in the following plugins: MBS CURL Plugin.