I use Cloudinary with Laravel and I want to let users to choose from the existing files or upload new. How can I generate authentication signatures on the BackEnd(php in my case)? and pass it to the front end (JavaScript)?
I've tried to use unsigned upload preset to let users upload without requiring them to be signed in, but no luck.
mediaWidget = cloudinary.createMediaLibrary({
cloud_name: "my-cloud-name",
api_key: 'my-api-key',
username: 'email id',
uploadPreset: "unsigned-upload-preset",
multiple: false,
}, {
insertHandler: function (data) {
data.assets.forEach(asset => { console.log("Inserted asset:",
JSON.stringify(asset, null, 2)) })
}
}
);
I'm getting no error, but it always require user to login into cloudinary account