Cloudtenary 2.0.3
dotnet add package Cloudtenary --version 2.0.3
NuGet\Install-Package Cloudtenary -Version 2.0.3
<PackageReference Include="Cloudtenary" Version="2.0.3" />
<PackageVersion Include="Cloudtenary" Version="2.0.3" />
<PackageReference Include="Cloudtenary" />
paket add Cloudtenary --version 2.0.3
#r "nuget: Cloudtenary, 2.0.3"
#:package Cloudtenary@2.0.3
#addin nuget:?package=Cloudtenary&version=2.0.3
#tool nuget:?package=Cloudtenary&version=2.0.3
Cloudtenary
A lightweight .NET wrapper around Cloudinary for effortless file uploads.
Table of Contents
Introduction
Cloudtenary is a small, elegant .NET library that simplifies connecting to Cloudinary and performing media operations such as uploading, transforming, and deleting images, videos, and documents.
It wraps the official CloudinaryDotNet SDK with intuitive, ready-to-use methods and dependency injection support for modern .NET projects.
Features
- Simple setup with a single
AddCloudtenary()extension method - Image upload with optional resizing, cropping, and quality transformations
- Video upload with support for resizing, trimming, fade effects, and text overlays
- Document (raw file) upload
- Clean deletion of any media type (image, video, or raw)
- Built with DI-friendly design (
ICloudtenaryinterface) - Small footprint, zero configuration clutter
Installation
Install the package via NuGet:
dotnet add package Cloudtenary
Or add it via the NuGet Package Manager in Visual Studio.
Configuration
In your appsettings.json or secret store, add your Cloudinary credentials:
"CloudtenarySettings": {
"CloudName": "your-cloud-name",
"Key": "your-api-key",
"Secret": "your-api-secret"
}
Registration
In your Program.cs or Startup.cs, register the service:
using Cloudtenary.Extensions;
using Cloudtenary.Settings;
builder.Services.AddCloudtenary(options =>
{
options.CloudName = builder.Configuration["CloudtenarySettings:CloudName"];
options.Key = builder.Configuration["CloudtenarySettings:Key"];
options.Secret = builder.Configuration["CloudtenarySettings:Secret"];
});
This automatically registers
ICloudtenaryas a singleton for dependency injection.
Usage
Inject the interface anywhere you need to upload or manage files:
using Cloudtenary;
using CloudinaryDotNet.Actions;
public class MediaService
{
private readonly ICloudtenary _cloudtenary;
public MediaService(ICloudtenary cloudtenary)
{
_cloudtenary = cloudtenary;
}
public async Task<string?> UploadImageAsync(Stream fileStream, string fileName)
{
var result = await _cloudtenary.UploadImageAsync(fileName, fileStream);
return result?.Url;
}
}
Example Methods
Upload an Image (with transformations)
Automatically resizes and optimizes the image:
await _cloudtenary.UploadImageAsync("avatar", "avatar.jpg", stream, 400, 400);
Upload an Image (original)
Uploads without any transformation:
await _cloudtenary.UploadImageAsync("avatar", stream);
Upload a Video (with effects)
Trims, fades in, and overlays text:
await _cloudtenary.UploadVideoAsync("intro.mp4", stream, 720, 480, 3, 60, "� Toba");
Upload a Document
Uploads any raw file (PDF, DOCX, ZIP, etc.):
await _cloudtenary.UploadRawFileAsync("resume.pdf", "resume.pdf", stream);
Delete a File
Removes any media type by its public ID:
await _cloudtenary.DeleteMediaFileAsync("videos/intro", ResourceType.Video);
Notes
CloudtenaryUploadResultcontainsPublicIdandUrl.- Videos are saved in the
/videosfolder, images in/images, and raw files in/documents. - Transformations use Cloudinary�s on-upload capabilities � no post-processing needed.
Links
- GitHub Repository: ojotobar/Cloudtenary
- Contact: ojotobar@gmail.com
- Cloudinary SDK: Official Docs
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- CloudinaryDotNet (>= 1.26.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.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.