Last active
October 16, 2022 13:24
-
-
Save charlesroper/ae6b4bb6516b705e52371380e706547f to your computer and use it in GitHub Desktop.
Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace HelloWorld | |
{ | |
using CloudinaryDotNet; | |
using CloudinaryDotNet.Actions; | |
using dotenv.net; | |
class Program | |
{ | |
static void Main() | |
{ | |
DotEnv.Load(new DotEnvOptions(probeForEnv: true)); | |
Cloudinary cloudinary = new Cloudinary(Environment.GetEnvironmentVariable("CLOUDINARY_URL")); | |
cloudinary.Api.Secure = true; | |
var uploadParams = new ImageUploadParams() | |
{ | |
File = new FileDescription(@"C:\Users\Charles\OneDrive\Pictures\Screenpresso\2022-10-15_06.png"), | |
UseFilename = true, | |
UniqueFilename = false, | |
Overwrite = true, | |
UploadPreset = "Obsidian" | |
}; | |
var uploadResult = cloudinary.Upload(uploadParams); | |
Console.WriteLine(uploadResult.JsonObj); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment