VoDA.FtpServer
1.3.6
See the version list below for details.
dotnet add package VoDA.FtpServer --version 1.3.6
NuGet\Install-Package VoDA.FtpServer -Version 1.3.6
<PackageReference Include="VoDA.FtpServer" Version="1.3.6" />
paket add VoDA.FtpServer --version 1.3.6
#r "nuget: VoDA.FtpServer, 1.3.6"
// Install VoDA.FtpServer as a Cake Addin #addin nuget:?package=VoDA.FtpServer&version=1.3.6 // Install VoDA.FtpServer as a Cake Tool #tool nuget:?package=VoDA.FtpServer&version=1.3.6
VoDA.FtpServer
Description
VoDA.FtpServer is a simple FTP server library. This library simplifies interaction with the FTP protocol down to the events level. All requests to the server related to authorization or working with data cause events that you must implement.
Quick start
To start the server, you need to create an FtpServerBuilder object, configure it using functions, as shown in the example below. For more information about each function, see ConfigurationParameters. After configuration, call the Build()
function to create a server.
An example of an FTP server for working with the file system is given in the Test project.
Example
var server = new FtpServerBuilder()
.ListenerSettings((config) =>
{
config.Port = 21; // enter the port
config.ServerIp = System.Net.IPAddress.Any;
})
.Log((config) =>
{
config.Level = LogLevel.Information; // enter log level. Default: Information
})
.Certificate((config) =>
{
config.CertificatePath = ".\\server.crt";
config.CertificateKey = ".\\server.key";
})
.Authorization((config) =>
{
config.UseAuthorization = true; // enable or disable authorization
config.UsernameVerification += (username) => {...}; // username verification
config.PasswordVerification += (username, password) => {...}; //verification of username and password
})
.FileSystem((fs) =>
{
fs.OnDeleteFile += (client, path) => {...}; // delete file event
fs.OnRename += (client, from, to) => {...}; // rename item event
fs.OnDownload += (client, path) => {...}; // download file event
fs.OnGetList += (client, path) => {...}; // get items in folder event
fs.OnExistFile += (client, path) => {...}; // file check event
fs.OnExistFoulder += (client, path) => {...}; // folder check event
fs.OnCreate += (client, path) => {...}; // file creation event
fs.OnAppend += (client, path) => {...}; // append file event
fs.OnDeleteFolder += (client, path) => {...}; // remove folder event
fs.OnUpload += (client, path) => {...}; // upload file event
fs.OnGetFileSize += (client, path) => {...}; // get file size event
})
.Build();
// Start FTP-serer
server.StartAsync(System.Threading.CancellationToken.None).Wait();
Or you can use your own class that inherits from the context class. An example is below.
In this example, class MyAuthorization
inherits from VoDA.FtpServer.Contexts.AuthorizationOptionsContext
and class MyFileSystem
inherits from VoDA.FtpServer.Contexts.FileSystemOptionsContext
var server = new FtpServerBuilder()
.ListenerSettings((config) =>
{
config.Port = 21; // enter the port
config.ServerIp = System.Net.IPAddress.Any;
})
.Log((config) =>
{
config.Level = LogLevel.Information; // enter log level. Default: Information
})
.Certificate((config) =>
{
config.CertificatePath = ".\\server.crt";
config.CertificateKey = ".\\server.key";
})
.Authorization<MyAuthorization>()
.FileSystem<MyFileSystem>()
.Build();
// Start FTP-serer
server.StartAsync(System.Threading.CancellationToken.None).Wait();
Full example see in Test project.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net5.0
- Serilog (>= 2.11.0)
- Serilog.Sinks.Console (>= 4.0.1)
- System.Security.Cryptography.OpenSsl (>= 5.0.0)
-
net6.0
- Serilog (>= 2.11.0)
- Serilog.Sinks.Console (>= 4.0.1)
- System.Security.Cryptography.OpenSsl (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.