C# library for Uploadcare. Uploadcare is a content delivery platform that optimizes web performance for developers, startups and large enterprises.
Supported features:
- Full Uploadcare API v0.5 (file, group, project and webhook, face detection)
- CDN path builder
- File uploads from disk, byteArray, and URL
- Signed uploads
- Simple and signed auth
TODO:
- Multi-part uploads
- Throttling
Latest stable version is available from NuGet Gallery
Using the .NET Core command-line interface (CLI) tools:
dotnet add package UploadcareCSharp
Using the NuGet Command Line Interface (CLI):
nuget install UploadcareCSharp
Using the Package Manager Console:
Install-Package UploadcareCSharp
From within Visual Studio:
- Open the Solution Explorer.
- Right-click on a project within your solution.
- Click on Manage NuGet Packages...
- Click on the Browse tab and search for "UploadcareCSharp".
- Click on the UploadcareCSharp package, select the appropriate version in the right-tab and click Install.
var client = UploadcareClient.DemoClientWithSignedAuth();
var project = await client.Projects.GetAsync();
var file = await client.Files.GetAsync("85b5644f-e692-4855-9db0-8c5a83096e25");
var file = await client.Files.GetAsync("85b5644f-e692-4855-9db0-8c5a83096e25");
var builder = new CdnPathBuilder(file)
.ResizeWidth(200)
.CropCenter(200, 200)
.Grayscale();
var url = builder.Build();
var file = new FileInfo("Lenna.png");
try
{
var uploader = new FileUploader(client);
var result = await uploader.Upload(file);
Console.Writeline(result.FileId);
}
catch (UploadFailureException ex)
{
Console.Writeline("Upload failed :(");
}
For any requests, bug or comments, please open an issue or submit a pull request.