Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Uploading Videos to Cloudinary with the .NET SDK

🧰 Uploading with the SDK in a .NET project

To use the SDK in a .NET project, first install the SDK:

dotnet add package CloudinaryDotNet

Then, add the necessary package reference

using CloudinaryDotNet;
using CloudinaryDotNet.Actions;

Finally, configure a new instance of Cloudinary:

Account account = new Account(
  "<Your Cloud Name>",
  "<Your API Key>",
  "<Your API Secret>");

Cloudinary cloudinary = new Cloudinary(account);

Finally, run the upload method, passing in your video source:

var uploadParams = new VideoUploadParams()
{
  File = new FileDescription("<Video Location or URL>")
};
var uploadResult = await cloudinary.UploadLargeAsync(uploadParams);

🚀 Get Started with This Example

  • Add the following environment variables via your shell
# In Bash
export CLOUDINARY_CLOUD_NAME=<Your Cloud Name>
export CLOUDINARY_API_KEY=<Your API Key>
export CLOUDINARY_API_SECRET=<Your API Secret>

# Or

# In CMD
set CLOUDINARY_CLOUD_NAME="<Your Cloud Name>"
set CLOUDINARY_API_KEY="<Your API Key>"
set CLOUDINARY_API_SECRET="<Your API Secret>"
  • Install the project dependencies with:
dotnet restore
  • Run the program with:
dotnet run

The program will run in your terminal and you'll see the URL results logged.