Cosmos.Network.Ftp 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Cosmos.Network.Ftp --version 2.0.0
                    
NuGet\Install-Package Cosmos.Network.Ftp -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cosmos.Network.Ftp" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cosmos.Network.Ftp" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Cosmos.Network.Ftp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cosmos.Network.Ftp --version 2.0.0
                    
#r "nuget: Cosmos.Network.Ftp, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cosmos.Network.Ftp@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cosmos.Network.Ftp&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Cosmos.Network.Ftp&version=2.0.0
                    
Install as a Cake Tool

<h1 align="center">CosmosFTP Server 🚀</h1> <p> <a href="https://www.nuget.org/packages/Cosmos.Network.Ftp/" target="_blank"> <img alt="Version" src="https://img.shields.io/nuget/v/Cosmos.Network.Ftp.svg" /> </a> <a href="https://github.com/CosmosOS/CosmosFtp/blob/main/LICENSE.txt" target="_blank"> <img alt="License: BSD Clause 3 License" src="https://img.shields.io/badge/license-BSD License-yellow.svg" /> </a> </p>

CosmosFTP is an FTP server made in C# for the Cosmos operating system construction kit.

Port of a C written Epitech project: NWP_myftp_2019

Usage

Add the package to your kernel .csproj:

<ItemGroup>
    <PackageReference Include="Cosmos.Network.Ftp" Version="2.0.0" />
</ItemGroup>

The kernel needs networking and storage (CosmosEnableNetwork, CosmosEnableStorage, both on by default), an IP configuration (DHCP or static) and a mounted filesystem. Listen() serves every client on the calling thread until Close() is called, so start it on a thread of its own to keep your shell:

using System.Threading;
using Cosmos.Network.Ftp;

FtpServer server = new("/mnt")
{
    // Optional: left out, any user name logs in with any password.
    Authenticate = (user, password) => user == "cosmos" && password == "cosmos",
    // Optional: one line per connection, command and failure.
    Log = message => Cosmos.Kernel.System.Diagnostics.Log.WriteString(message + "\n"),
};

new Thread(server.Listen).Start();

// Later, to stop serving:
server.Close();

Data connections

Passive mode is the one to use. Each passive transfer listens on a port from PassivePortMin to PassivePortMax (50000 to 50009 by default). Active mode (PORT, EPRT) only connects back to the address the client is connected from, so it does not work through NAT.

Reaching a kernel running in QEMU

With QEMU user-mode networking, forward the control port and every passive port to the guest. With the Cosmos CLI:

cosmos run --hostfwd tcp::2121-:21 --hostfwd tcp::50000-:50000 --hostfwd tcp::50001-:50001  # and so on, up to 50009

Building and testing

dotnet test Cosmos.Network.Ftp.slnx

The tests run the server on the host, over loopback, against a raw FTP client.

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

📝 License

Copyright © 2022-2026 CosmosOS.

This project is BSD Clause 3 licensed.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 126 10/2/2026
2.0.1 104 10/2/2026
2.0.0 6,731 10/1/2026