S95.AspNetCore.Cloudinary 1.0.0

dotnet add package S95.AspNetCore.Cloudinary --version 1.0.0                
NuGet\Install-Package S95.AspNetCore.Cloudinary -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="S95.AspNetCore.Cloudinary" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add S95.AspNetCore.Cloudinary --version 1.0.0                
#r "nuget: S95.AspNetCore.Cloudinary, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install S95.AspNetCore.Cloudinary as a Cake Addin
#addin nuget:?package=S95.AspNetCore.Cloudinary&version=1.0.0

// Install S95.AspNetCore.Cloudinary as a Cake Tool
#tool nuget:?package=S95.AspNetCore.Cloudinary&version=1.0.0                

AspNetCore.Cloudinary

AspNetCore.Cloudinary is a middleware for ASP.NET Core applications designed to modify all hyperlinks (href) and source links (src) in the HTML responses to a specified Cloudinary link. It uses automatic uploading of assets to Cloudinary, ensuring that all your resources are efficiently managed and delivered through Cloudinary's CDN.

Features

  • Dynamic Link Replacement: Automatically replaces all href and src attributes in HTML responses with a specified Cloudinary link.
  • Automatic Asset Upload: Seamlessly uploads local assets to Cloudinary, ensuring they are always available and served from Cloudinary's CDN.
  • Easy Integration: Simple setup and integration into existing ASP.NET Core projects.
  • Efficient Processing: Directly manipulates the response stream for efficient content modification.
  • Configuration Flexibility: Easily configurable through middleware extension methods.

How to use

  1. Add Auto upload mapping on Cloudinary account:
Folder: Media
URL prefix: https://www.{yourWebsite}.com/media/
  1. Install the AspNetCore.Cloudinary NuGet package in your AspNetCore project.
  2. In Program.cs add this:
builder.Services.Configure<S95.AspNetCore.Cloudinary.Models.Configuration>(builder.Configuration.GetSection("Cloudinary"));

app.UseMiddleware<CloudinaryMiddleware>();
  1. Configure the package in appsettings.json.
  2. Middleware is not active in DEVELOPMENT profile.

Configuration example in appsettings.json

"Cloudinary": {
  "Url": "https://res.cloudinary.com/{yourCloudinaryAccount}/image/upload/f_auto$1$2$3$4$5/media/$6",
  "ExcludePaths": "umbraco"
}

Licence

Project is licensed under the MIT License

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 111 6/6/2024