How to get URL of an uploaded image in v2.0 widget.
I've used v1.0 and always got url and secured_url in response after upload.
Now that I moved to v2.0 I get a few responses per widget but none of them contain the image's public url
Any idea how to get it?
Thanks.
-
Hi. I figure it out. I had to set asynchronous to "off" in my upload preset.
1 -
Hi Gilad,
Could you please share with your code?
Generally speaking, here you can find the URL:
var widget = cloudinary.createUploadWidget({
cloud_name: cloud_name,
upload_preset: preset_name,
sources: ['local', 'url'],
}, (error, result) => {if (result.event === "success") {
console.log(result.info.secure_url);
widget.close();
}
});$("#upload_btn").click(function () {
widget.open();
});I'm looking forward to your response.
Cheers,
Yakir
0 -
Im having the same issue, adding
console.log(result.info.secure_url)
Doesn't seem to do anything, as the widget closes after upload.What should I put to display the url on the widget after upload?
0 -
Here is a sample code:
https://jsfiddle.net/shirlymanor/om6u03pn/
Can you please try to set your cloud name and upload preset and see if you can see the uploaded URL?
0 -
This doesn't work, at least not anymore. It always returns "undefined."
0 -
Hi Scott,
Thanks for your update.
If there's anything else that we could help with, please don't hesitate to reach us.
0
Post is closed for comments.
Comments
6 comments