PhatBrainSoftware.Cloudinary 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package PhatBrainSoftware.Cloudinary --version 1.0.1
NuGet\Install-Package PhatBrainSoftware.Cloudinary -Version 1.0.1
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="PhatBrainSoftware.Cloudinary" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PhatBrainSoftware.Cloudinary --version 1.0.1
#r "nuget: PhatBrainSoftware.Cloudinary, 1.0.1"
#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 PhatBrainSoftware.Cloudinary as a Cake Addin
#addin nuget:?package=PhatBrainSoftware.Cloudinary&version=1.0.1

// Install PhatBrainSoftware.Cloudinary as a Cake Tool
#tool nuget:?package=PhatBrainSoftware.Cloudinary&version=1.0.1

Introduction

Cloudinary for Blazor applications - Uses Cloudinary.

Getting Setup

You can install the package via the NuGet package manager just search for PhatBrainSoftware.Cloudinary. You can also install via powershell using the following command.

Install-Package PhatBrainSoftware.Cloudinary

Or via the dotnet CLI.

dotnet add package PhatBrainSoftware.Cloudinary

If you're using Visual Studio you can also install via the built in NuGet package manager.

Add the following to _Imports.razor:

@using PhatBrainSoftware.Cloudinary

Add the following to Program.cs:

builder.Services.AddTransient(sp => new CloudinaryUploadWidget(sp.GetService<IJSRuntime>()));

Basic Example

See code in the Index.razor page in the repo for more examples.

@page "/"

@inject IConfiguration Configuration

<button class="btn btn-primary" type="submit" @onclick="@OnUploadClick">Upload</button>

@code {
    [Inject]
    CloudinaryUploadWidget CloudinaryUploadWidget { get; set; }

    protected async override Task OnInitializedAsync()
    {
        var cloudinaryUploadWidgetOptions =
            new CloudinaryUploadWidgetOptions
                {
                    CloudName = this.Configuration["CLOUDINARY_CLOUD_NAME"],
                    Folder = "test",
                    Sources = new[] { "local", "url", "camera" },
                    CroppingAspectRatio = 1,
                    MaximumImageHeight = 200,
                    MaximumImageWidth = 200
                };

        await this.CloudinaryUploadWidget.CreateAsync(cloudinaryUploadWidgetOptions);
    }

    protected async Task OnUploadClick(
        MouseEventArgs mouseEventArgs)
    {
        await this.CloudinaryUploadWidget.OpenWidgetAsync();
    }
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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.5 599 5/1/2022
1.0.4 390 4/30/2022
1.0.3 391 4/30/2022
1.0.2 380 4/30/2022
1.0.2-alpha 139 4/30/2022
1.0.1 391 4/29/2022