{"id":49079313,"url":"https://github.com/fmisrl/ftpserver","last_synced_at":"2026-04-20T12:08:59.132Z","repository":{"id":351075985,"uuid":"1209383060","full_name":"fmisrl/ftpserver","owner":"fmisrl","description":"A lightweight, modern FTP server library for .NET.","archived":false,"fork":false,"pushed_at":"2026-04-13T14:34:17.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-13T15:13:10.939Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fmisrl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-13T11:24:06.000Z","updated_at":"2026-04-13T14:34:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/fmisrl/ftpserver","commit_stats":null,"previous_names":["fmisrl/ftpserver"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/fmisrl/ftpserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmisrl%2Fftpserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmisrl%2Fftpserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmisrl%2Fftpserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmisrl%2Fftpserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmisrl","download_url":"https://codeload.github.com/fmisrl/ftpserver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmisrl%2Fftpserver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32046460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-20T12:08:58.322Z","updated_at":"2026-04-20T12:08:59.126Z","avatar_url":"https://github.com/fmisrl.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# FmiSrl.FtpServer\n\n[![Build, Test and Publish](https://github.com/fmisrl/ftpserver/actions/workflows/publish.yml/badge.svg)](https://github.com/fmisrl/ftpserver/actions/workflows/publish.yml)\n\nA lightweight, modern FTP server library for .NET.\n\n## Features\n\n- Fully asynchronous operation.\n- Supports both Dependency Injection and manual instantiation.\n- Extensible authentication and file system providers.\n- Built-in support for common FTP commands (USER, PASS, LIST, RETR, STOR, etc.).\n- PASV mode support.\n\n## Installation\n\n```bash\ndotnet add package FmiSrl.FtpServer.Server\n```\n\n## Usage\n\n### With Dependency Injection (Recommended)\n\nTo use the FTP server in a modern .NET application (e.g., ASP.NET Core, Worker Service), register it in your `Program.cs`:\n\n```csharp\nusing Microsoft.Extensions.DependencyInjection;\nusing FmiSrl.FtpServer.Server;\nusing FmiSrl.FtpServer.Server.DependencyInjection;\nusing FmiSrl.FtpServer.Server.Services;\n\nvar builder = Host.CreateApplicationBuilder(args);\n\n// Configure Options for Providers\nbuilder.Services.Configure\u003cPhysicalFileSystemProviderOptions\u003e(opt =\u003e\n{\n    opt.RootDirectory = \"./my_ftp_root\";\n});\n\nbuilder.Services.Configure\u003cSimpleAuthenticationProviderOptions\u003e(opt =\u003e\n{\n    opt.Username = \"admin\";\n    opt.Password = \"secure_password\";\n});\n\n// Add FTP Server and configure providers via generic DI\nbuilder.Services.AddFtpServer(options =\u003e\n{\n    options.FtpPort = 21;\n    options.ServerName = \"My Custom FTP Server\";\n})\n.UseFileSystemProvider\u003cPhysicalFileSystemProvider\u003e()\n.UseAuthenticationProvider\u003cSimpleAuthenticationProvider\u003e();\n\nvar host = builder.Build();\n\n// Get the server instance and start it\nvar ftpServer = host.Services.GetRequiredService\u003cFtpServer\u003e();\nawait ftpServer.StartAsync();\n\nawait host.RunAsync();\n```\n\nThe server is registered as a **Singleton** by default.\n\n### Without Dependency Injection\n\nYou can also use the library in simple console applications or legacy projects without a DI container:\n\n```csharp\nusing FmiSrl.FtpServer.Server;\nusing FmiSrl.FtpServer.Server.Services;\nusing Microsoft.Extensions.Logging.Abstractions;\nusing Microsoft.Extensions.Options;\n\nvar serverOptions = Options.Create(new FtpServerConfigurationOptions\n{\n    FtpPort = 2121,\n    ServerName = \"Standalone FTP Server\"\n});\n\nvar fsOptions = Options.Create(new PhysicalFileSystemProviderOptions\n{\n    RootDirectory = \"./ftp_root\"\n});\n\nvar authOptions = Options.Create(new SimpleAuthenticationProviderOptions\n{\n    Username = \"user\",\n    Password = \"password\"\n});\n\n// Providers are strictly required\nvar ftpServer = new FtpServer(\n    new PhysicalFileSystemProvider(fsOptions),\n    new SimpleAuthenticationProvider(authOptions),\n    serverOptions,\n    NullLogger\u003cFtpServer\u003e.Instance\n);\n\nawait ftpServer.StartAsync();\nConsole.WriteLine(\"Server started. Press any key to stop.\");\nConsole.ReadKey();\nawait ftpServer.StopAsync();\n```\n\n## Configuration\n\n### Logging\n\nThe library uses `Microsoft.Extensions.Logging`. When using DI, it will automatically use the configured logging providers (e.g., Serilog, Console, Debug).\n\nWhen used manually, you can pass any `ILogger\u003cFtpServer\u003e` implementation to the constructor.\n\n### Authentication Provider\n\nImplement the `IAuthenticationProvider` interface to customize how users are authenticated:\n\n```csharp\npublic interface IAuthenticationProvider\n{\n    Task\u003cbool\u003e AuthenticateAsync(string username, string password);\n}\n```\n\n### File System Provider\n\nImplement the `IFileSystemProvider` interface to provide custom storage (e.g., Azure Blob Storage, Database, S3).\nIt provides an `FtpAuthenticationContext` which includes the currently authenticated username:\n\n```csharp\nusing FmiSrl.FtpServer.Server.Abstractions;\n\npublic interface IFileSystemProvider\n{\n    Task\u003cIEnumerable\u003cFileSystemEntry\u003e\u003e GetEntriesAsync(FtpAuthenticationContext authContext, string path);\n    Task\u003cStream\u003e OpenReadAsync(FtpAuthenticationContext authContext, string path);\n    Task\u003cStream\u003e OpenWriteAsync(FtpAuthenticationContext authContext, string path);\n    Task DeleteFileAsync(FtpAuthenticationContext authContext, string path);\n    Task CreateDirectoryAsync(FtpAuthenticationContext authContext, string path);\n    Task DeleteDirectoryAsync(FtpAuthenticationContext authContext, string path);\n    Task\u003cbool\u003e FileExistsAsync(FtpAuthenticationContext authContext, string path);\n    Task\u003cbool\u003e DirectoryExistsAsync(FtpAuthenticationContext authContext, string path);\n    Task RenameAsync(FtpAuthenticationContext authContext, string oldPath, string newPath);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmisrl%2Fftpserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmisrl%2Fftpserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmisrl%2Fftpserver/lists"}