Foundatio.Storage.SshNet
Foundatio provides SFTP-based file storage via SSH.NET. View source on GitHub →
Overview
| Implementation | Interface | Package |
|---|---|---|
SshNetFileStorage | IFileStorage | Foundatio.Storage.SshNet |
Installation
bash
dotnet add package Foundatio.Storage.SshNetUsage
csharp
using Foundatio.Storage;
var storage = new SshNetFileStorage(o =>
o.ConnectionString = "host=sftp.example.com;username=user;password=pass;path=/uploads");
await storage.SaveFileAsync("documents/report.pdf", pdfStream);
var stream = await storage.GetFileStreamAsync("documents/report.pdf");Configuration
| Option | Type | Required | Description |
|---|---|---|---|
ConnectionString | string | ✅ | Connection string |
PrivateKey | Stream | Private key for authentication | |
PrivateKeyPassPhrase | string | Private key passphrase | |
Proxy | string | Proxy server | |
ProxyType | ProxyTypes | Proxy type |
For additional options, see SshNetFileStorageOptions source.
Next Steps
- File Storage Guide - Usage patterns and best practices
- Serialization - Configure serialization