GithubHelp home page GithubHelp logo

skyformat99 / ftpserver-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fubardevelopment/ftpserver

0.0 1.0 0.0 5.17 MB

Portable FTP server written in .NET

Home Page: http://fubardevelopment.github.io/FtpServer/

License: MIT License

C# 100.00%

ftpserver-1's Introduction

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<DotNetFileSystemOptions>(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<FtpServerOptions>(opt => opt.ServerAddress = "127.0.0.1");

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

    // 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();
}

ftpserver-1's People

Contributors

aramis-ci avatar avonheimburg avatar fubar-coder avatar gee19 avatar hytgbn avatar lafe avatar lsvhome avatar mvacha avatar nonegiven avatar omelhus avatar pashcovich avatar patrickhofman avatar wdantuma avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.