Skip to content

Latest commit

History

693 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

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 nameDescriptionBadge
FubarDev.FtpServerCore libraryFubarDev.FtpServer
FD.FS.AbstractionsBasic typesFubarDev.FtpServer.Abstractions
FD.FS.FileSystem.DotNetSystem.IO-based file systemFubarDev.FtpServer.FileSystem.DotNet
FD.FS.FileSystem.GoogleDriveGoogle Drive as file systemFubarDev.FtpServer.FileSystem.GoogleDrive
FD.FS.FileSystem.InMemoryIn-memory file systemFubarDev.FtpServer.FileSystem.InMemory
FD.FS.FileSystem.UnixUnix file systemFubarDev.FtpServer.FileSystem.Unix
FD.FS.MembershipProvider.PamPAM membership providerFubarDev.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 injectionvarservices=newServiceCollection();// use %TEMP%/TestFtpServer as root folderservices.Configure<DotNetFileSystemOptions>(opt =>opt.RootPath=Path.Combine(Path.GetTempPath(),"TestFtpServer"));// Add FTP server services// DotNetFileSystemProvider = Use the .NET file system functionality// AnonymousMembershipProvider = allow only anonymous loginsservices.AddFtpServer(builder =>builder.UseDotNetFileSystem()// Use the .NET file system functionality.EnableAnonymousAuthentication());// allow anonymous logins// Configure the FTP serverservices.Configure<FtpServerOptions>(opt =>opt.ServerAddress="127.0.0.1");// Build the service providerusing(varserviceProvider=services.BuildServiceProvider()){// Initialize the FTP servervarftpServerHost=serviceProvider.GetRequiredService<IFtpServerHost>();// Start the FTP serverftpServerHost.StartAsync(CancellationToken.None).Wait();Console.WriteLine("Press ENTER/RETURN to close the test application.");Console.ReadLine();// Stop the FTP serverftpServerHost.StopAsync(CancellationToken.None).Wait();}

About

Portable FTP server written in .NET

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages