Public id for signed uploads
Hi,
I cannot figure out why I cannot set a public id when using signed uploads.
I'm using these init options with the createUploadWidget method:
const widget = cloudinary.createUploadWidget(
{
cloudName,
apiKey,
uploadSignatureTimestamp,
uploadSignature,
folder:"test",
// publicId: "special",
})
And signing like this:
const signature = cloudinary.v2.utils.api_sign_request(
{
timestamp,
source:"uw",
folder:"test",
// publicId: "special",
}, cloudinary.v2.config().api_secret);
But I'm getting the signature invalid error. If I remove the publicIds from both, then the uploads work perfectly fine.
-
Hi Adrian,
Thank you for reaching out.
When you sign the request in the backend, set the public id parameter as public_id instead of just publicId (this is what the widget uses).
So in the widget set:
publicId: "special"
In the backend, set:
public_id: "special"
Please let me know if you have any other questions or queries.
Kind Regards,
Thomas1 -
Thank you Thomas,
I could not figure that out from the docs. It works now!
0 -
Hi Adrian,
No problem at all, glad it's working.
Please let me know if you have any other questions or queries.
Kind Regards,
Thomas0
Post is closed for comments.
Comments
3 comments