Need help with FtpServer?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

FubarDevelopment
275 Stars 101 Forks MIT License 691 Commits 25 Opened issues

Description

Portable FTP server written in .NET

Services available

!
?

Need anything else?

Contributors list

Portable FTP server

Build Status

This FTP server is written as .NET Standard 2.0 library and has an abstract file system which allows e.g. Google Drive as backend.

License

The library is released under the MIT license.

Support the development

Patreon

Prerequisites

Compilation

  • Visual Studio 2019 / C# 8.0

Using

  • Visual Studio 2019
  • .NET Standard 2.0 (everything except sample application, PAM authentication)
  • .NET Core 3.0 (sample application, PAM authentication)

NuGet packages

| Package name | Description | Badge | |-----------------------------------|-------------------------------|-------| |

FubarDev.FtpServer
| Core library | FubarDev.FtpServer | |
FD.FS.Abstractions
| Basic types | FubarDev.FtpServer.Abstractions | |
FD.FS.FileSystem.DotNet
|
System.IO
-based file system | FubarDev.FtpServer.FileSystem.DotNet | |
FD.FS.FileSystem.GoogleDrive
| Google Drive as file system | FubarDev.FtpServer.FileSystem.GoogleDrive | |
FD.FS.FileSystem.InMemory
| In-memory file system | FubarDev.FtpServer.FileSystem.InMemory | |
FD.FS.FileSystem.Unix
| Unix file system | FubarDev.FtpServer.FileSystem.Unix | |
FD.FS.MembershipProvider.Pam
| PAM membership provider | FubarDev.FtpServer.MembershipProvider.Pam |

Example FTP server

Creating the project

dotnet new console
dotnet add package FubarDev.FtpServer.FileSystem.DotNet
dotnet add package FubarDev.FtpServer
dotnet add package Microsoft.Extensions.DependencyInjection

Contents of
Main
in Program.cs

// Setup dependency injection
var services = new ServiceCollection();

// use %TEMP%/TestFtpServer as root folder services.Configure(opt => opt .RootPath = Path.Combine(Path.GetTempPath(), "TestFtpServer"));

// Add FTP server services // DotNetFileSystemProvider = Use the .NET file system functionality // AnonymousMembershipProvider = allow only anonymous logins services.AddFtpServer(builder => builder .UseDotNetFileSystem() // Use the .NET file system functionality .EnableAnonymousAuthentication()); // allow anonymous logins

// Configure the FTP server services.Configure(opt => opt.ServerAddress = "127.0.0.1");

// Build the service provider using (var serviceProvider = services.BuildServiceProvider()) { // Initialize the FTP server var ftpServerHost = serviceProvider.GetRequiredService();

// Start the FTP server
ftpServerHost.StartAsync(CancellationToken.None).Wait();

Console.WriteLine("Press ENTER/RETURN to close the test application.");
Console.ReadLine();

// Stop the FTP server
ftpServerHost.StopAsync(CancellationToken.None).Wait();

}

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.