Skip to content

libcURL.FTPWildCard

Andrew Lambert edited this page Sep 26, 2023 · 2 revisions

libcURL.FTPWildCard

Class Declaration

 Protected Class FTPWildCard
 Inherits libcURL.EasyHandle

Remarks

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.

Downloading to memory

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.

Event Definitions

Methods

Properties

Clone this wiki locally