Cloudinary cloudinary = new Cloudinary(Environment.GetEnvironmentVariable("CLOUDINARY_URL"));

Tom7254
Tom7254 Member Posts: 4
edited May 15 in Developer APIs

When I run my app I get the following error.

System.UriFormatException: 'Invalid URI: The hostname could not be parsed.'

I am running this on a blazor app and I am trying to upload my images.

Can anyone help?

Thanks

Tagged:

Answers

  • SreeCloudinary
    SreeCloudinary Member, Cloudinary Staff Posts: 44

    Hi @Tom7254

    Typically the Cloudinary URL would contain the value as shown below. Can you please confirm if you are not using CLOUDINARY_URL as part of the string.

    CLOUDINARY_URL=cloudinary://APIKey:APISecret@test

    Also, if you are using API call, then you probably have the base address wrong. For example,

    POST https://api.cloudinary.com/v1_1/demo/image/upload
    

    Please see the below article for more information:

    https://cloudinary.com/documentation/image_upload_api_reference#overview

    Thanks,
    Sree

  • endpointsystems
    endpointsystems Member Posts: 6

    Hi Tom,

    I've been working on a Blazor/Cloudinary app (with Syncfusion controls) for some time. I put together a quick and dirty demo of using Cloudinary with Blazor that you can find here:

    https://github.com/elvogel/EPS.Demos.BlazorCloudinary

    It's slightly dated, as it uses .NET 6, but hopefully that should help you get started.

  • Tamara
    Tamara Member, Cloudinary Staff Posts: 123

    Hi @endpointsystems,

    Thanks for the help!

    Best
    - Tamara