A modern .NET client library for the Pixeldrain file hosting service API.
- Upload files with progress reporting
- Download files with progress reporting
- Rename files
- Delete files
- Fully asynchronous API
- Cancellation support
- Strong typing and exception handling
dotnet add package Pixeldrain
using Pixeldrain;
using Pixeldrain.API;
var client = new PixeldrainClient("<api-key>");
var filesApi = client.Files;
// Simple upload
string fileId = await filesApi.UploadAsync("example.txt", File.OpenRead("path/to/file.txt"));
// Upload with progress reporting
var progress = new Progress<long>(bytesUploaded =>
Console.WriteLine($"Uploaded {bytesUploaded} bytes"));
string fileId = await filesApi.UploadAsync(
"example.txt",
File.OpenRead("path/to/file.txt"),
progress);
// Simple download
await filesApi.DownloadAsync(fileId, File.Create("path/to/destination.txt"));
// Download with progress reporting
var progress = new Progress<long>(bytesDownloaded =>
Console.WriteLine($"Downloaded {bytesDownloaded} bytes"));
await filesApi.DownloadAsync(
fileId,
File.Create("path/to/destination.txt"),
progress);
// Rename a file
await filesApi.RenameAsync(fileId, "new-name.txt");
// Delete a file
await filesApi.DeleteAsync(fileId);
- .NET 9.0 or later
This project is licensed under the MIT License - see the LICENSE file for details.