-
-
Notifications
You must be signed in to change notification settings - Fork 11
libcURL.FTPWildCard
libcURL.FTPWildCard
Protected Class FTPWildCard
Inherits libcURL.EasyHandle
This class wraps libcURL's built-in FTP WildCard download feature. If libcURL understands the server's directory listing format, then you can use this class to enumerate or download all the files in a remote directory whose name matches a specific pattern.
Since this class is a subclass of EasyHandle, it can be used anywhere an EasyHandle is expected. This means that you can use the cURLClient class to conduct WildCard transfers:
Dim outputdir As FolderItem = SelectFolder()
Dim w As New libcURL.FTPWildCard
w.LocalRoot = outputdir
Dim c As New cURLClient(w) ' pass the FTPWildCard to cURLSession.Constructor(EasyHandle)
If Not c.Get("ftp://ftp.example.com/pub/*.htm*") Then ' use a pattern in the URL
MsgBox("Error: " + Str(c.LastError))
Else
MsgBox("Success!")
outputdir.Launch
End If
See this page for a description of supported patterns.
You may also implement custom pattern matching by setting CustomMatch=True
and handling the PatternMatch
event.
You may avoid writing downloaded data to disk by setting the LocalRoot
property (or the LocalFile
parameter to the QueueFile
event) to Nil
and handling the DataAvailable
event.
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2014-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.