Upload to Cloudinary with .Net SDK - Invalid Signature

Aperta
#385 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
csharp
Ambito
api, backend

Direzione di ricerca

Inizia riproducendo l'esempio C# fornito con Cloudinary.Upload, ImageUploadParams, AddCustomParam e SignatureAlgorithm.SHA256. Confronta la firma generata e la stringa del server con i parametri di upload documentati, quindi verifica come l'SDK interpreta Metadata rispetto ai parametri personalizzati. Il lavoro è completato quando l'upload dei metadati documentato produce una firma valida e la richiesta ha esito positivo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug report for Cloudinary .NET SDK

Before proceeding, please update to latest version and test if the issue persists

Describe the bug in a sentence or two.

When using the .NET SDK, it appears to not generate any signature. Additionally, my Cloudinary team requires metadata and the only way I can fulfill that requirement is with "addcustomparam" function.

Issue Type (Can be multiple)

  • Build - Cannot install or import the SDK
  • Performance - Performance issues
  • [ X ] Behaviour - Functions are not working as expected (such as generate URL)
  • [ X ] Documentation - Inconsistency between the docs and behaviour
  • Other (Specify)

Steps to reproduce

Account account = new Account("","","");
Cloudinary cloudinary = new Cloudinary(account);
cloudinary.Api.SignatureAlgorithm = SignatureAlgorithm.SHA256;

var uploadParams = new ImageUploadParams()
{
File = new FileDescription("IMG_2019.jpeg",File.OpenRead(file)),
UploadPreset = "",
Folder = ""
};

uploadParams.AddCustomParam("category","artwork");

var uploadResult = cloudinary.Upload(uploadParams);
Console.WriteLine(uploadResult.JsonObj);

Error screenshots or Stack Trace (if applicable)

When attempting to upload the file, the response is always: ""message": "Invalid Signature 6832973aae19f7f322bb88d48c7b34731c390f04cb9fafd5353ea5e5178639ea. String to sign - 'folder=&timestamp=1768517629&upload_preset='.""

If I try to set the Metadata in the ImageUploadParams() as the documentation suggests, I get the error that you cannot convert a "X" to a bool. the key work Metadata does not hold the same meaning though the documentation indicates it does.

OS and Version

  • Linux
  • [ X ] Windows
  • [ X ] macOS
  • MultiPlatform

Versions and Libraries (fill in the version numbers)

  • Cloudinary .NET SDK version - 1.27.9
  • .NET Core - 9.0.304
  • .NET Framework - n/a

Repository

I'm not sure on the repository. I can confirm that the same configuration works if I use the cloudinary-cli option.

If possible, please provide a link to a reproducible repository that showcases the problem

Lingua principale
C#
Stelle
105
Fork
72
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cloudinary/CloudinaryDotNet

Tutte le issue di cloudinary/CloudinaryDotNet

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.