Skip to content

FTPS Monitor

Robin Rodricks edited this page Dec 8, 2024 · 9 revisions

Architecture

diagram

Overview

FluentFTP includes high-level classes that will monitor any number of folders on an FTP(S) server and generate events when files are added, edited or deleted.

You can use this to implement FTP monitoring functionality on any client program or cloud service.

API

Classes

Create an instance of any one of these classes to monitor an FTP server.

  • new FtpMonitor() - regular synchronous monitor
  • new AsyncFtpClient() - regular async monitor
  • new BlockingAsyncFtpMonitor() - unusual async pattern monitor (documented here)

Configuration

The FTP monitor classes have these settings:

  • monitor.ChangeDetected - Event handler or callback that will be triggered when any files have changed.

  • monitor.PollInterval - Gets or sets the polling interval. Default: 10 minutes.

  • monitor.Recursive - Gets or sets whether to recursively monitor subfolders. Default: false.

  • monitor.WaitForUpload - Whether to wait for list items to be fully uploaded (having a stable file size) before reporting them as added. Default: true.

How do I monitor folders on my FTP(S) server?

  1. You must create an FTP client class which can connect to your FTP server.
  2. Create any FTP monitor class, and provide it your FTP client instance, which it will exclusively use to connect to your FTP server.
  3. You must then provide a set of FTP folder paths that it should monitor (in the constructor).
  4. It will periodically check the FTP folder (by getting a listing of files) and then compare the previous listing with the current listing, to see which files have been changed.
  5. If any files have changed, it will trigger the ChangeDetected event/callback with the details passed to your application in a FtpMonitorEventArgs object
Clone this wiki locally