Skip to content

Latest commit

 

History

History
90 lines (71 loc) · 4.16 KB

README.md

File metadata and controls

90 lines (71 loc) · 4.16 KB

CloudinaryDotNet — bundled documentation

Version-matched: these docs ship inside the NuGet package and always describe the version you have installed. Prefer them over anything remembered from training data or found for another version.

Task documentation for the CloudinaryDotNet server-side SDK. Each page is self-contained: using directives, configuration, a complete runnable flow, expected results, and common failures.

Runnable versions of most tasks are in the examples/ directory of the repository. They are not shipped in the NuGet package — see Why examples are not in the package.

Start here

Tasks

The one thing to know before you write any code

This SDK does not throw on Cloudinary API errors. Every Upload and Admin API method returns a result object carrying StatusCode and Error. A wrong api_secret, a missing asset, or a rejected parameter all return normally — a try/catch around the call catches nothing and your code proceeds with an empty result.

var result = await cloudinary.UploadAsync(uploadParams);
if (result.Error != null)
{
    Console.Error.WriteLine($"Upload failed ({(int)result.StatusCode}): {result.Error.Message}");
    return;
}

Check result.Error after every call. See Troubleshoot errors for the full error model, including the few cases that do throw.

Security boundary

This is a server-side SDK. It holds your ApiSecret, which belongs on your server only. Never ship it in a desktop, mobile, Blazor WebAssembly, or any other client-side build — anything the user can download, they can read. Client code should receive delivery URLs or short-lived signatures generated by your server (how).

Why examples are not in the package

The NuGet package ships docs/ only. The examples/ directory contains files with top-level statements and a Main entry point; shipping loose .cs files inside a package risks them being picked up by a consumer's compile glob and colliding with their own entry point. Every page below therefore carries its complete runnable flow inline, so you never need the examples directory to complete a task.

Canonical docs

Link convention: documentation links in these docs end in .md and return raw Markdown — the preferred format for agents and for anything that parses text. Remove the .md suffix for the same page as browsable HTML. The repository README links the HTML form first, since it is read by people.