.NET Best Open Source FTP Client Library

.NET Best Open Source FTP Client Library

FluentFTP is an FTP and FTPS client for .NET and .NET Standard.

Last updated 7/17/2023 7:59 PM
工具箱
2 min read
Category
.NET
Tags
.NET C# Open Source

FluentFTP is an FTP and FTPS client for .NET and .NET Standard.

Optimized for speed, with no external dependencies, and written entirely in C#.

Features

Full support for FTP, FXP, FTPS, FTPS with TLS 1.3, FTPS with client certificates, and FTPS proxies.

Comprehensive support for over 30 types of FTP servers.

Supports various file and directory listings (Unix, Windows/IIS, Azure, Pure-FTPd, ProFTPD, Vax, VMS, OpenVMS, Tandem, HP NonStop Guardian, IBM z/OS and OS/400, Windows CE, Serv-U, etc.).

Supports recursive directory listing and directory deletion.

Easily upload and download files from the server with progress tracking.

Create, append, read, write, rename, move, and delete files and folders.

Async support – all operations can be used with async await.

C# Usage Example

// Create connection with username and password
var client = new AsyncFtpClient("123.123.123.123", "david", "pass123");

// Connect to the server with auto-reconnect
await client.AutoConnect();

// List all files
foreach (FtpListItem item in await client.GetListing("/htdocs")) {

    // If it's a file
    if (item.Type == FtpObjectType.File) {

        // Get file size
        long size = await client.GetFileSize(item.FullName);

        // Compute file hash
        FtpHash hash = await client.GetChecksum(item.FullName);
    }

    // Get modification time of file or folder
    DateTime time = await client.GetModifiedTime(item.FullName);
}

// Upload a file
await client.UploadFile(@"C:\MyVideo.mp4", "/htdocs/MyVideo.mp4");

// Move a file
await client.MoveFile("/htdocs/MyVideo.mp4", "/htdocs/MyVideo_2.mp4");

// Download a file
await client.DownloadFile(@"C:\MyVideo_2.mp4", "/htdocs/MyVideo_2.mp4");

// Delete a file
await client.DeleteFile("/htdocs/MyVideo_2.mp4");

// Disconnect and close
await client.Disconnect();

Project URL

https://github.com/robinrodricks/FluentFTP

Keep Exploring

Related Reading

More Articles